Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions daemoncmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
# streams.
si = open(stdin, 'r')
so = open(stdout, 'a+')
se = open(stderr, 'a+', 0)
se = open(stderr, 'a+b', 0)

# hack and bug: when sys.stdin.close() has already been called,
# os.dup2 throws an exception: ValueError: I/O operation on closed file
Expand Down Expand Up @@ -271,7 +271,7 @@ def running(pid):
return False
try:
os.kill(pid, signal.SIG_DFL)
except OSError, exc:
except OSError as exc:
if exc.errno == errno.ESRCH:
# The specified PID does not exist
return False
Expand Down