Commits

Philip Jenvey committed ad48ce2

don't hardcode the version

  • Participants
  • Parent commits 0e3e287

Comments (0)

Files changed (1)

pypy/module/cpyext/test/test_cpyext.py

         kwds["libraries"] = [api_library]
         # '%s' undefined; assuming extern returning int
         kwds["compile_extra"] = ["/we4013"]
-        # prevent linking with python27.lib
-        kwds["link_extra"]=["/NODEFAULTLIB:Python27.lib"]
+        # prevent linking with PythonXX.lib
+        w_maj, w_min = space.fixedview(space.sys.get('version_info'), 5)[:2]
+        kwds["link_extra"] = ["/NODEFAULTLIB:Python%d%d.lib" %
+                              (space.int_w(w_maj), space.int_w(w_min))]
     elif sys.platform == 'darwin':
         kwds["link_files"] = [str(api_library + '.dylib')]
     else: