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

samepid feature doesn't work as expected #15

Closed rasup closed 6 years ago

rasup commented 6 years ago

script.py:

pidfile = PidFile(allow_samepid=True)
pidfile.create()
while True:
   time.sleep(1)

If I start this script twice I would expect the second create() to raise a PidFileError but it doesn't.

I'm using version 2.1.1

trbs commented 6 years ago

Could you please create a PR with a test for this in our test suite ?

Thanks !

trbs commented 6 years ago

Thanks a lot for the PR and fix !