Changeset 844
- Timestamp:
- 11/23/15 07:32:25 (6 months ago)
- Location:
- mystic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/examples3/test_searcher.py
r842 r844 10 10 # start = time.time() 11 11 # if available, use a multiprocessing worker pool 12 try: #NOTE: ThreadPool and ParallelPool fail12 try: #NOTE: ParallelPool fails 13 13 from pathos.helpers import freeze_support 14 14 freeze_support() -
mystic/mystic/abstract_solver.py
r843 r844 824 824 825 825 # activate signal handler 826 #import threading as thread 827 #mainthread = isinstance(thread.current_thread(), thread._MainThread) 828 #if mainthread: #XXX: if not mainthread, signal will raise ValueError 826 829 import signal 827 if self._handle_sigint: signal.signal(signal.SIGINT,self.signal_handler) 830 if self._handle_sigint: 831 signal.signal(signal.SIGINT,self.signal_handler) 828 832 829 833 # register: cost, termination, ExtraArgs … … 837 841 838 842 # restore default handler for signal interrupts 839 signal.signal(signal.SIGINT,signal.default_int_handler) 843 if self._handle_sigint: 844 signal.signal(signal.SIGINT,signal.default_int_handler) 840 845 return 841 846 -
mystic/mystic/ensemble.py
r793 r844 106 106 107 107 # activate signal_handler 108 #import threading as thread 109 #mainthread = isinstance(thread.current_thread(), thread._MainThread) 110 #if mainthread: #XXX: if not mainthread, signal will raise ValueError 108 111 import signal 109 if self._handle_sigint: signal.signal(signal.SIGINT,self.signal_handler) 112 if self._handle_sigint: 113 signal.signal(signal.SIGINT,self.signal_handler) 110 114 111 115 # register termination function … … 228 232 229 233 # restore default handler for signal interrupts 230 signal.signal(signal.SIGINT,signal.default_int_handler) 234 if self._handle_sigint: 235 signal.signal(signal.SIGINT,signal.default_int_handler) 231 236 232 237 # log any termination messages … … 303 308 304 309 # activate signal_handler 310 #import threading as thread 311 #mainthread = isinstance(thread.current_thread(), thread._MainThread) 312 #if mainthread: #XXX: if not mainthread, signal will raise ValueError 305 313 import signal 306 if self._handle_sigint: signal.signal(signal.SIGINT,self.signal_handler) 314 if self._handle_sigint: 315 signal.signal(signal.SIGINT,self.signal_handler) 307 316 308 317 # register termination function … … 418 427 419 428 # restore default handler for signal interrupts 420 signal.signal(signal.SIGINT,signal.default_int_handler) 429 if self._handle_sigint: 430 signal.signal(signal.SIGINT,signal.default_int_handler) 421 431 422 432 # log any termination messages
Note: See TracChangeset
for help on using the changeset viewer.