Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e6bb7eb2
Commit
e6bb7eb2
authored
Mar 25, 2015
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23765: Removed IsBadStringPtr calls in ctypes
parent
632a77e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
Lib/ctypes/__init__.py
Lib/ctypes/__init__.py
+4
-8
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/ctypes/__init__.py
View file @
e6bb7eb2
...
...
@@ -237,14 +237,8 @@ _check_size(c_char)
class
c_char_p
(
_SimpleCData
):
_type_
=
"z"
if
_os
.
name
==
"nt"
:
def
__repr__
(
self
):
if
not
windll
.
kernel32
.
IsBadStringPtrA
(
self
,
-
1
):
return
"%s(%r)"
%
(
self
.
__class__
.
__name__
,
self
.
value
)
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
cast
(
self
,
c_void_p
).
value
)
else
:
def
__repr__
(
self
):
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
cast
(
self
,
c_void_p
).
value
)
def
__repr__
(
self
):
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
c_void_p
.
from_buffer
(
self
).
value
)
_check_size
(
c_char_p
,
"P"
)
class
c_void_p
(
_SimpleCData
):
...
...
@@ -259,6 +253,8 @@ from _ctypes import POINTER, pointer, _pointer_type_cache
class
c_wchar_p
(
_SimpleCData
):
_type_
=
"Z"
def
__repr__
(
self
):
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
c_void_p
.
from_buffer
(
self
).
value
)
class
c_wchar
(
_SimpleCData
):
_type_
=
"u"
...
...
Misc/NEWS
View file @
e6bb7eb2
...
...
@@ -30,6 +30,8 @@ Core and Builtins
Library
-------
-
Issue
#
23765
:
Removed
IsBadStringPtr
calls
in
ctypes
-
Issue
#
22364
:
Improved
some
re
error
messages
using
regex
for
hints
.
-
Issue
#
23742
:
ntpath
.
expandvars
()
no
longer
loses
unbalanced
single
quotes
.
...
...
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