chiark / gitweb /
fishdescriptor: Use Python "errno" module
[chiark-utils.git] / fishdescriptor / py / fishdescriptor / indonor.py
index e227fb24b53a7a538ae6827a662f6ce9e7cbb0a2..d911bf85c52d772a10bf7e3ad9f715eba670149f 100644 (file)
@@ -27,6 +27,7 @@ import copy
 import os
 import sys
 import socket
+import errno
 
 def _string_bytearray(s):
     # gets us bytes in py2 and py3
@@ -212,7 +213,7 @@ class DonorImplementation():
         )
         if r < 0:
             errnoval = di._parse_eval_errno('%s')
-            if errnoval != os.errno.EEXIST:
+            if errnoval != errno.EEXIST:
                 raise RuntimeError("mkdir %s failed: `%s'" %
                                    (repr(path), os.strerror(errnoval)))
             return 0