diff options
author | Skip Montanaro <skip@pobox.com> | 2013-02-24 14:10:04 -0600 |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2013-02-24 14:10:04 -0600 |
commit | bf2627a5b9f83e1bbcf1b5030a693acb6236a211 (patch) | |
tree | 71ce9b0f543263bbd689f1ce86cb26536372ea4b | |
parent | f04c8900efe71dcdd8fa3365415d87cb4759ed9c (diff) | |
download | lockfile-bf2627a5b9f83e1bbcf1b5030a693acb6236a211.tar.gz |
python 3 tweaks
-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: |