pytest-dev/pytest-localserver

Remove `/usr/bin/env python` lines where appropriate

diazona opened this issue · 0 comments

Discussed in #29

Originally posted by rominf March 3, 2022

is useless since there is nothing except fixtures in the file.

I'm not sure about this:

#!/usr/bin/env python

since there is a code:
if __name__ == "__main__": # pragma: no cover
import time
server = Server()
server.start()
print('SMTP server is running on %s:%i' % server.addr)
print('Type <Ctrl-C> to stop')
try:
try:
while True:
time.sleep(1)
finally:
print('\rstopping...')
server.stop()
except KeyboardInterrupt:
# support for Python 2.4 dictates that try ... finally is not used
# together with any except statements
pass

but it's ancient; not sure if someone still uses it.