chiark / gitweb /
fishdescriptor: Use Python "errno" module
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Dec 2019 17:49:45 +0000 (17:49 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Dec 2019 17:49:47 +0000 (17:49 +0000)
Use Python "errno" module, not "os.errno" (which is not in modern
python3 apparently).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
debian/changelog
fishdescriptor/py/fishdescriptor/fish.py
fishdescriptor/py/fishdescriptor/indonor.py

index 683712185e0f30364e5529dcebb3d526c3b9a9c7..fe3c111585004ea101ac3fdcf68e5959e00cde1b 100644 (file)
@@ -1,6 +1,7 @@
 chiark-utils (6.0.5~citrix1) unstable; urgency=medium
 
-  * 
+  * fishdescriptor: Use Python "errno" module, not "os.errno"
+    (which is not in modern python3 apparently).
 
  --
 
index dcb7c32ac817a3bcbfb2cc50a803933938c6e69a..7588010d6833b976e0f255a1f1aa3f14f25c9d53 100644 (file)
@@ -29,6 +29,7 @@ import struct
 import tempfile
 import shutil
 import sys
+import errno
 
 def _shuffle_fd3():
     os.dup2(1,3)
@@ -111,7 +112,7 @@ class Donor():
             os.stat(path)
             return True
         except OSError as oe:
-            if oe.errno != os.errno.ENOENT: raise oe
+            if oe.errno != errno.ENOENT: raise oe
             return False
 
     def _sock_dir(d, target_euid, target_root):
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