Source

pypy / lib_pypy / _testcapi.py

Diff from to

lib_pypy/_testcapi.py

     output_dir = tempfile.mkdtemp()
 
     from distutils.ccompiler import new_compiler
+    from distutils import sysconfig
+
     compiler = new_compiler()
     compiler.output_dir = output_dir
 
     object_filename = res[0]
 
     # set link options
+    output_filename = '_testcapi' + sysconfig.get_config_var('SO')
     if sys.platform == 'win32':
-        output_filename = '_testcapi.pyd'
         # XXX libpypy-c.lib is currently not installed automatically
         library = os.path.join(thisdir, '..', 'include', 'libpypy-c')
         libraries = [library, 'oleaut32']
         extra_ldargs = ['/MANIFEST',  # needed for VC10
                         '/EXPORT:init_testcapi']
     else:
-        output_filename = '_testcapi.so'
         libraries = []
         extra_ldargs = []