Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
e9210428
Commit
e9210428
authored
Jul 31, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: convert NULL return values to None
parent
d7b1ce91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
bindings/python-ctypes/generate.py
bindings/python-ctypes/generate.py
+7
-2
No files found.
bindings/python-ctypes/generate.py
View file @
e9210428
...
@@ -470,12 +470,17 @@ def generate_wrappers(methods):
...
@@ -470,12 +470,17 @@ def generate_wrappers(methods):
for classname, el in itertools.groupby(elements, key=operator.itemgetter(0)):
for classname, el in itertools.groupby(elements, key=operator.itemgetter(0)):
print """
print """
class %(name)s(object):
class %(name)s(object):
def __
init__(self
, pointer=None):
def __
new__(cls
, pointer=None):
'''Internal method used for instanciating wrappers from ctypes.
'''Internal method used for instanciating wrappers from ctypes.
'''
'''
if pointer is None:
if pointer is None:
raise Exception("Internal method. You should instanciate objects through other class methods (probably named '
new
' or ending with '
new
')")
raise Exception("Internal method. You should instanciate objects through other class methods (probably named '
new
' or ending with '
new
')")
self._as_parameter_=ctypes.c_void_p(pointer)
if pointer == 0:
return None
else:
o=object.__new__(cls)
o._as_parameter_=ctypes.c_void_p(pointer)
return o
@staticmethod
@staticmethod
def from_param(arg):
def from_param(arg):
...
...
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