diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-11 20:02:47 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-11 20:02:47 +0200 |
commit | 98f3ed1a9c99a07b15f54b78f521ad84ccbad126 (patch) | |
tree | 4a80604e1d4586891e354c6f83a7e05ac8960bc1 /pyLoadCore.py | |
parent | pavement build script (diff) | |
download | pyload-98f3ed1a9c99a07b15f54b78f521ad84ccbad126.tar.xz |
working restart core method
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index 9a32b78cc..ae84f111c 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -30,7 +30,7 @@ from imp import find_module import logging import logging.handlers import os -from os import _exit, execl, getcwd, makedirs, remove, sep, walk, chdir +from os import _exit, execl, getcwd, makedirs, remove, sep, walk, chdir, close from os.path import exists, join import signal import subprocess @@ -544,6 +544,13 @@ class Core(object): def restart(self): self.shutdown() chdir(owd) + # close some open fds + for i in range(3,50): + try: + close(i) + except : + pass + execl(executable, executable, *sys.argv) _exit(0) |