~garyvdm/+junk/python-daemon-py3

« back to all changes in this revision

Viewing changes to daemon/runner.py

  • Committer: Gary van der Merwe
  • Date: 2011-12-23 09:40:41 UTC
  • Revision ID: garyvdm@gmail.com-20111223094041-xbyrmrd65b1hfjh6
Change to the new "except Exception as exc:"  except syntax.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        pid = self.pidfile.read_pid()
141
141
        try:
142
142
            os.kill(pid, signal.SIGTERM)
143
 
        except OSError, exc:
 
143
        except OSError as exc:
144
144
            raise DaemonRunnerStopFailureError(
145
145
                "Failed to terminate %(pid)d: %(exc)s" % vars())
146
146
 
225
225
    if pidfile_pid is not None:
226
226
        try:
227
227
            os.kill(pidfile_pid, signal.SIG_DFL)
228
 
        except OSError, exc:
 
228
        except OSError as exc:
229
229
            if exc.errno == errno.ESRCH:
230
230
                # The specified PID does not exist
231
231
                result = True