trbs / pid

Pidfile featuring stale detection and file-locking, can also be used as context-manager or decorator
https://pypi.python.org/pypi/pid/
Apache License 2.0
102 stars 26 forks source link

Fix samepid bug #15 #16

Closed rasup closed 6 years ago

rasup commented 6 years ago

My attempt at fixing #15 which turned out to be simpler than I thought - unless I've missed something. There's also a test like you asked for. I haven't written a ton of Python unittests so maybe there's a nicer way to do it.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.2%) to 94.611% when pulling 06e51cdb0423d0221af62bb2851dd78071a357da on rasup:fix_samepid_bug into 16e41d9a63b3824a133deb34d70a96612d8cd2dc on trbs:master.

rasup commented 6 years ago

When I run python2 setup.py test I get a whole bunch of (I don't know why):

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/rasmus/code/pid/pid/__init__.py", line 201, in close
    if self.filename and os.path.isfile(self.filename) and cleanup:
AttributeError: 'NoneType' object has no attribute 'path'
trbs commented 6 years ago

Thanks !