-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
This may be user error vs. a bug, but if so maybe a documentation update could be made to explain what I'm doing wrong?
import pidfile
import sys
import time
def main():
time.sleep(5)
if __name__ == '__main__':
print('Initializing process')
try:
with pidfile.PIDFile('/var/run/myprogram.pid'):
print('Creating PID file...')
main()
except pidfile.AlreadyRunningError:
print('Program already running!')
sys.exit(1)
sys.exit(0)
Based on the documentation, I expected the above to work, but it doesn't. Instead, I get AttributeError: module 'pidfile' has no attribute 'PIDFile'.
This is with Python 3.9.2 on Linux 5.15.84, aarch64 (Raspberry Pi), everything is straight from the Raspbian repos on a clean installation.
Metadata
Metadata
Assignees
Labels
No labels