Skip to content

Commit

Permalink
Merge pull request #329 from nolsto/stdlib-setsid
Browse files Browse the repository at this point in the history
Use setsid function from Python's os module
  • Loading branch information
tamland committed Jul 27, 2015
2 parents abb1072 + c9fb86c commit c05183a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/watchdog/tricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ def __init__(self, command, patterns=None, ignore_patterns=None,
kill_after=10):
super(AutoRestartTrick, self).__init__(
patterns, ignore_patterns, ignore_directories)
self.command = ['setsid'] + command
self.command = command
self.stop_signal = stop_signal
self.kill_after = kill_after
self.process = None

def start(self):
self.process = subprocess.Popen(self.command)
self.process = subprocess.Popen(self.command, preexec_fn=os.setsid)

def stop(self):
if self.process is None:
Expand Down

0 comments on commit c05183a

Please sign in to comment.