Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
bdb8315c
Unverified
Kaydet (Commit)
bdb8315c
authored
Kas 23, 2017
tarafından
Berker Peksag
Kaydeden (comit)
GitHub
Kas 23, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
üst
5ce1069a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
test_msilib.py
Lib/test/test_msilib.py
+40
-1
2017-11-19-09-46-27.bpo-1102.NY-g1F.rst
...WS.d/next/Windows/2017-11-19-09-46-27.bpo-1102.NY-g1F.rst
+4
-0
_msi.c
PC/_msi.c
+5
-1
No files found.
Lib/test/test_msilib.py
Dosyayı görüntüle @
bdb8315c
""" Test suite for the code in msilib """
import
unittest
from
test.support
import
import_module
from
test.support
import
TESTFN
,
import_module
,
unlink
msilib
=
import_module
(
'msilib'
)
import
msilib.schema
def
init_database
():
path
=
TESTFN
+
'.msi'
db
=
msilib
.
init_database
(
path
,
msilib
.
schema
,
'Python Tests'
,
'product_code'
,
'1.0'
,
'PSF'
,
)
return
db
,
path
class
MsiDatabaseTestCase
(
unittest
.
TestCase
):
def
test_view_fetch_returns_none
(
self
):
db
,
db_path
=
init_database
()
properties
=
[]
view
=
db
.
OpenView
(
'SELECT Property, Value FROM Property'
)
view
.
Execute
(
None
)
while
True
:
record
=
view
.
Fetch
()
if
record
is
None
:
break
properties
.
append
(
record
.
GetString
(
1
))
view
.
Close
()
db
.
Close
()
self
.
assertEqual
(
properties
,
[
'ProductName'
,
'ProductCode'
,
'ProductVersion'
,
'Manufacturer'
,
'ProductLanguage'
,
]
)
self
.
addCleanup
(
unlink
,
db_path
)
class
Test_make_id
(
unittest
.
TestCase
):
#http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx
...
...
Misc/NEWS.d/next/Windows/2017-11-19-09-46-27.bpo-1102.NY-g1F.rst
0 → 100644
Dosyayı görüntüle @
bdb8315c
Return ``None`` when ``View.Fetch()`` returns ``ERROR_NO_MORE_ITEMS``
instead of raising ``MSIError``.
Initial patch by Anthony Tuininga.
PC/_msi.c
Dosyayı görüntüle @
bdb8315c
...
...
@@ -723,8 +723,12 @@ view_fetch(msiobj *view, PyObject*args)
int
status
;
MSIHANDLE
result
;
if
((
status
=
MsiViewFetch
(
view
->
h
,
&
result
))
!=
ERROR_SUCCESS
)
status
=
MsiViewFetch
(
view
->
h
,
&
result
);
if
(
status
==
ERROR_NO_MORE_ITEMS
)
{
Py_RETURN_NONE
;
}
else
if
(
status
!=
ERROR_SUCCESS
)
{
return
msierror
(
status
);
}
return
record_new
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment