Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c49b4d8

Browse files
committed
Remove disabled ctypes test
The test was commented out in 2005 before ctypes was added to Python, because the “cdll” attribute loading feature “will no longer work this way”: http://svn.python.org/view?view=revision&revision=49102
1 parent 6c58c34 commit c49b4d8

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

Lib/ctypes/test/test_find.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
import os, os.path
2+
import os.path
33
import sys
44
import test.support
55
from ctypes import *
@@ -69,28 +69,5 @@ def test_shell_injection(self):
6969
self.assertFalse(os.path.lexists(test.support.TESTFN))
7070
self.assertIsNone(result)
7171

72-
# On platforms where the default shared library suffix is '.so',
73-
# at least some libraries can be loaded as attributes of the cdll
74-
# object, since ctypes now tries loading the lib again
75-
# with '.so' appended of the first try fails.
76-
#
77-
# Won't work for libc, unfortunately. OTOH, it isn't
78-
# needed for libc since this is already mapped into the current
79-
# process (?)
80-
#
81-
# On MAC OSX, it won't work either, because dlopen() needs a full path,
82-
# and the default suffix is either none or '.dylib'.
83-
@unittest.skip('test disabled')
84-
@unittest.skipUnless(os.name=="posix" and sys.platform != "darwin",
85-
'test not suitable for this platform')
86-
class LoadLibs(unittest.TestCase):
87-
def test_libm(self):
88-
import math
89-
libm = cdll.libm
90-
sqrt = libm.sqrt
91-
sqrt.argtypes = (c_double,)
92-
sqrt.restype = c_double
93-
self.assertEqual(sqrt(2), math.sqrt(2))
94-
9572
if __name__ == "__main__":
9673
unittest.main()

0 commit comments

Comments
 (0)