diff options
-rw-r--r-- | lockfile/pidlockfile.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lockfile/pidlockfile.py b/lockfile/pidlockfile.py index 3fc8f63..a965ba8 100644 --- a/lockfile/pidlockfile.py +++ b/lockfile/pidlockfile.py @@ -78,7 +78,7 @@ class PIDLockFile(LockBase): while True: try: write_pid_to_pidfile(self.path) - except OSError, exc: + except OSError as exc: if exc.errno == errno.EEXIST: # The lock creation failed. Maybe sleep a bit. if timeout is not None and time.time() > end_time: @@ -159,7 +159,7 @@ def write_pid_to_pidfile(pidfile_path): """ open_flags = (os.O_CREAT | os.O_EXCL | os.O_WRONLY) - open_mode = 0644 + open_mode = 0o644 pidfile_fd = os.open(pidfile_path, open_flags, open_mode) pidfile = os.fdopen(pidfile_fd, 'w') @@ -186,7 +186,7 @@ def remove_existing_pidfile(pidfile_path): """ try: os.remove(pidfile_path) - except OSError, exc: + except OSError as exc: if exc.errno == errno.ENOENT: pass else: |