Commits

Massimiliano Torromeo committed 0e0c80f

Fixes exception handling for python3

  • Participants
  • Parent commits bebc3aa

Comments (0)

Files changed (1)

simpledaemon/base.py

                 try:
                     # poll the process state
                     os.kill(pid, 0)
-                except OSError, why:
-                    if why[0] == errno.ESRCH:
+                except OSError, (code, text):
+                    if code == errno.ESRCH:
                         # process has died
                         break
                     else:
     for i in range(3):
         try:
             os.dup2(null, i)
-        except OSError, e:
-            if e.errno != errno.EBADF:
+        except OSError, (code, text):
+            if code != errno.EBADF:
                 raise
     os.close(null)