Skip to content

Commit

Permalink
Fix unclosed file error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Doyle committed Mar 9, 2018
1 parent 92daa59 commit 403c8c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def daemonise(self):
# write pidfile
atexit.register(self.delpid)
pid = str(os.getpid())
open(self.pidfile, 'w+').write(f'{pid}')
open(self.pidfile, 'w+').write(f'{pid}').close()

pid = str(os.getpid())
with open(self.pidfile, 'w+') as f:
Expand Down

0 comments on commit 403c8c6

Please sign in to comment.