File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import unittest
2- import os , os .path
2+ import os .path
33import sys
44import test .support
55from 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-
9572if __name__ == "__main__" :
9673 unittest .main ()
You can’t perform that action at this time.
0 commit comments