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
934f5633
Kaydet (Commit)
934f5633
authored
Eki 09, 2012
tarafından
Richard Oudkerk
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #16169: Merge
üst
c9061a5a
ea69bd3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
__init__.py
Lib/ctypes/__init__.py
+1
-1
test_win32.py
Lib/ctypes/test/test_win32.py
+22
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/ctypes/__init__.py
Dosyayı görüntüle @
934f5633
...
...
@@ -456,7 +456,7 @@ if _os.name in ("nt", "ce"):
code
=
GetLastError
()
if
descr
is
None
:
descr
=
FormatError
(
code
)
.
strip
()
return
WindowsError
(
code
,
descr
)
return
WindowsError
(
None
,
descr
,
None
,
code
)
if
sizeof
(
c_uint
)
==
sizeof
(
c_void_p
):
c_size_t
=
c_uint
...
...
Lib/ctypes/test/test_win32.py
Dosyayı görüntüle @
934f5633
...
...
@@ -67,6 +67,28 @@ if sys.platform == "win32":
self
.
assertEqual
(
ex
.
text
,
"text"
)
self
.
assertEqual
(
ex
.
details
,
(
"details"
,))
class
TestWinError
(
unittest
.
TestCase
):
def
test_winerror
(
self
):
# see Issue 16169
import
errno
ERROR_INVALID_PARAMETER
=
87
msg
=
FormatError
(
ERROR_INVALID_PARAMETER
)
.
strip
()
args
=
(
errno
.
EINVAL
,
msg
,
None
,
ERROR_INVALID_PARAMETER
)
e
=
WinError
(
ERROR_INVALID_PARAMETER
)
self
.
assertEqual
(
e
.
args
,
args
)
self
.
assertEqual
(
e
.
errno
,
errno
.
EINVAL
)
self
.
assertEqual
(
e
.
winerror
,
ERROR_INVALID_PARAMETER
)
windll
.
kernel32
.
SetLastError
(
ERROR_INVALID_PARAMETER
)
try
:
raise
WinError
()
except
OSError
as
exc
:
e
=
exc
self
.
assertEqual
(
e
.
args
,
args
)
self
.
assertEqual
(
e
.
errno
,
errno
.
EINVAL
)
self
.
assertEqual
(
e
.
winerror
,
ERROR_INVALID_PARAMETER
)
class
Structures
(
unittest
.
TestCase
):
def
test_struct_by_value
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
934f5633
...
...
@@ -42,6 +42,8 @@ Core and Builtins
Library
-------
- Issue #16169: Fix ctypes.WinError()'s confusion between errno and winerror.
- Issue #1492704: shutil.copyfile() raises a distinct SameFileError now if
source and destination are the same file. Patch by Atsuo Ishimoto.
...
...
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