partial cleanup of zeronet.py
This commit is contained in:
parent
adcee874db
commit
d45e162e7f
1 changed files with 46 additions and 39 deletions
17
zeronet.py
17
zeronet.py
|
@ -1,15 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Included modules
|
||||
import os
|
||||
import gc
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
# ZeroNet Modules
|
||||
import update
|
||||
|
||||
|
||||
def main():
|
||||
print "- Starting ZeroNet..."
|
||||
import sys, os
|
||||
|
||||
main = None
|
||||
try:
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) # Imports relative to src
|
||||
import main
|
||||
main.start()
|
||||
if main.update_after_shutdown: # Updater
|
||||
import update, sys, os, gc
|
||||
# Try cleanup openssl
|
||||
try:
|
||||
if "lib.opensslVerify" in sys.modules:
|
||||
|
@ -28,8 +37,7 @@ def main():
|
|||
handler.close()
|
||||
logger.removeHandler(handler)
|
||||
|
||||
except Exception, err: # Prevent closing
|
||||
import traceback
|
||||
except (Exception, ): # Prevent closing
|
||||
traceback.print_exc()
|
||||
traceback.print_exc(file=open("log/error.log", "a"))
|
||||
|
||||
|
@ -46,4 +54,3 @@ def main():
|
|||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
|
Loading…
Reference in a new issue