2
0
Эх сурвалжийг харах

Use errno rather than hardcoded windows error number.

Jelmer Vernooij 7 жил өмнө
parent
commit
5d722b33fd

+ 2 - 2
dulwich/object_store.py

@@ -718,8 +718,8 @@ class DiskObjectStore(PackBasedObjectStore):
         try:
         try:
             os.rename(path, basename + ".pack")
             os.rename(path, basename + ".pack")
         except OSError as e:
         except OSError as e:
-            if e.errno == 183:
-                # File already exists, on Windows.
+            if e.errno == errno.EEXIST:
+                # This can happen on Windows..
                 # It's safe to ignore this, since if the file already exists,
                 # It's safe to ignore this, since if the file already exists,
                 # it should have the same contents as the one we just
                 # it should have the same contents as the one we just
                 # generated.
                 # generated.