Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(128580)

Unified Diff: Lib/ctypes/test/test_prototypes.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/ctypes/test/test_pointers.py ('k') | Lib/ctypes/test/test_refcounts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/ctypes/test/test_prototypes.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/ctypes/test/test_prototypes.py Wed Mar 02 00:01:35 2016 +0000
@@ -1,8 +1,9 @@
+import os
from ctypes import *
from ctypes.test import need_symbol
import unittest
# IMPORTANT INFO:
#
# Consider this call:
# func.restype = c_char_p
@@ -18,17 +19,17 @@ import unittest
# If the arglist would be destroyed BEFORE the result has been built,
# the c_char_p("123") object would already have a zero refcount,
# and the pointer passed to (and returned by) the function would
# probably point to deallocated space.
#
# In this case, there would have to be an additional reference to the argument...
import _ctypes_test
-testdll = CDLL(_ctypes_test.__file__)
+testdll = CDLL(getattr(_ctypes_test, '__file__', os.environ['TEST_EXECUTABLE']))
# Return machine address `a` as a (possibly long) non-negative integer.
# Starting with Python 2.5, id(anything) is always non-negative, and
# the ctypes addressof() inherits that via PyLong_FromVoidPtr().
def positive_address(a):
if a >= 0:
return a
# View the bits in `a` as unsigned instead.
« no previous file with comments | « Lib/ctypes/test/test_pointers.py ('k') | Lib/ctypes/test/test_refcounts.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+