Commits

Antoine Pitrou committed 1438df2

Fix running under Windows with py 2.7.

Comments (0)

Files changed (1)

 except ImportError:
     nt = None
 else:
-    if sys.getwindowsversion()[:2] >= (6, 0):
+    if sys.getwindowsversion()[:2] >= (6, 0) and sys.version_info >= (3, 2):
         from nt import _getfinalpathname
     else:
         supports_symlinks = False
     rename = _wrap_binary_strfunc(os.rename)
 
     if nt:
-        symlink = _wrap_binary_strfunc(os.symlink)
+        if supports_symlinks:
+            symlink = _wrap_binary_strfunc(os.symlink)
+        else:
+            def symlink(a, b, target_is_directory):
+                raise NotImplementedError("symlink() not available on this system")
     else:
         # Under POSIX, os.symlink() takes two args
         @staticmethod