This commit is contained in:
Colombo 2020-02-29 15:24:14 +04:00
parent c900c65c31
commit 27e24d5d28
4 changed files with 9 additions and 25 deletions

View file

@ -357,8 +357,6 @@ class InteractBase(object):
return result
def input_process(self, stdin_fd, sq, str):
from core import osex
osex.linux_ignore_UserWarning()
sys.stdin = os.fdopen(stdin_fd)
try:
inp = input (str)
@ -387,9 +385,6 @@ class InteractBase(object):
return inp
def input_process_skip_pending(self, stdin_fd):
from core import osex
osex.linux_ignore_UserWarning()
sys.stdin = os.fdopen(stdin_fd)
while True:
try:

View file

@ -54,10 +54,7 @@ class Subprocessor(object):
def log_err(self, msg): self.c2s.put ( {'op': 'log_err' , 'msg':msg } )
def progress_bar_inc(self, c): self.c2s.put ( {'op': 'progress_bar_inc' , 'c':c } )
def _subprocess_run(self, client_dict, s2c, c2s):
from core import osex
osex.linux_ignore_UserWarning()
def _subprocess_run(self, client_dict, s2c, c2s):
self.c2s = c2s
data = None
is_error = False
@ -80,7 +77,7 @@ class Subprocessor(object):
time.sleep(0.001)
self.on_finalize()
c2s.put ( {'op': 'finalized'} )
c2s.put ( {'op': 'finalized'} )
except Subprocessor.SilenceException as e:
c2s.put ( {'op': 'error', 'data' : data} )
except Exception as e:
@ -89,7 +86,7 @@ class Subprocessor(object):
print ('Exception while process data [%s]: %s' % (self.get_data_name(data), traceback.format_exc()) )
else:
print ('Exception: %s' % (traceback.format_exc()) )
c2s.close()
s2c.close()
self.c2s = None

View file

@ -33,12 +33,4 @@ def get_screen_size():
elif 'linux' in sys.platform:
pass
return (1366, 768)
def linux_ignore_UserWarning():
if sys.platform[0:3] != 'win':
# fix for Linux , Ignoring :
# /usr/lib/python3.6/multiprocessing/semaphore_tracker.py:143:
# UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
import warnings
warnings.filterwarnings(action='ignore', message='semaphore_tracker')
return (1366, 768)

10
main.py
View file

@ -3,9 +3,6 @@ if __name__ == "__main__":
import multiprocessing
multiprocessing.set_start_method("spawn")
from core import osex
osex.linux_ignore_UserWarning()
from core.leras import nn
nn.initialize_main_env()
@ -14,7 +11,8 @@ if __name__ == "__main__":
import time
import argparse
from core import pathex
from core import pathex
from core import osex
from pathlib import Path
from core.interact import interact as io
@ -352,7 +350,9 @@ if __name__ == "__main__":
arguments.func(arguments)
print ("Done.")
else:
import warnings
warnings.filterwarnings(action='ignore', message='semaphore_tracker')
'''
import code
code.interact(local=dict(globals(), **locals()))