Skip to content

Commit 45fe2ea

Browse files
Update reloader.py
1 parent 6373af7 commit 45fe2ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎telebot/ext/reloader.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ def restart_file():
1818
p = psutil.Process(os.getpid())
1919
for handler in p.open_files() + p.connections():
2020
os.close(handler.fd)
21+
except OSError:
22+
pass
2123
except Exception as e:
2224
logger.error(e)
2325

2426
python = sys.executable
25-
os.execl(python, python, *sys.argv)
27+
28+
if os.name == 'nt':
29+
os.execv(sys.executable, ['python'] + sys.argv)
30+
else:
31+
os.execl(python, python, *sys.argv)

0 commit comments

Comments
 (0)