diff --git a/PyMine/PyMine.py b/PyMine/PyMine.py index 3ce63db509908af6292c976e22c17ebba1b0816f..2cea972b68bec36b41db8dc4dd2793027c6621d3 100644 --- a/PyMine/PyMine.py +++ b/PyMine/PyMine.py @@ -397,15 +397,16 @@ class PyTimer : def run(cls): try: while (cls.getRunFlag() == True): - cls.__lock = thread.allocate() + cls._lock = thread._allocate_lock() + # cls.__lock = thread.allocate() time.sleep(0.2) cls.__timetict += 1 cls.innerTimeCounter.resetCounter(cls.__timetict//5) print("zzz") if cls.__lock.acquire(): cls.__lock.release() - except (BaseException , data): - print(data) + except BaseException as e: + print(e) @classmethod def getRunFlag(cls): @@ -422,7 +423,8 @@ class PyTimer : if cls.getRunFlag() == False : cls.__runFlag = True cls.__timetict = 0 - thread.start_new(cls.run, ()) + thread._start_new_thread(cls.run, ()) + #thread.start_new(cls.run, ()) @singleton class RestartRunner(threading.Thread): diff --git a/PyMine/WinFrame.py b/PyMine/WinFrame.py index 253ebef6226f2ac48ee15914db7787514b9596de..7a8322e415cec343570da05f87616a0e0db624f8 100644 --- a/PyMine/WinFrame.py +++ b/PyMine/WinFrame.py @@ -1,6 +1,7 @@ import wx import threading import threading as thread +import time class Singleton(object): def __new__(cls, *args, **kw): diff --git a/PyMine/__pycache__/AboutFrame.cpython-36.pyc b/PyMine/__pycache__/AboutFrame.cpython-36.pyc index 6cab1d03e46062487c256cf2bbad1ebc91e3b746..66c99873edc3d9d9dbfb8ef9a0db3408fcf19f80 100644 Binary files a/PyMine/__pycache__/AboutFrame.cpython-36.pyc and b/PyMine/__pycache__/AboutFrame.cpython-36.pyc differ diff --git a/PyMine/__pycache__/MineAlgo.cpython-36.pyc b/PyMine/__pycache__/MineAlgo.cpython-36.pyc index aff47dc8dbbd7186cbaa12e039044ae5c651418a..d2811ffb0a6b66873dac6863097a813a96e29b80 100644 Binary files a/PyMine/__pycache__/MineAlgo.cpython-36.pyc and b/PyMine/__pycache__/MineAlgo.cpython-36.pyc differ diff --git a/PyMine/__pycache__/MineButton.cpython-36.pyc b/PyMine/__pycache__/MineButton.cpython-36.pyc index e87e695c5208f2a9beef41b3aa3c52702141c042..b424840d4cdfff94e218affa0c2110d9b933bc60 100644 Binary files a/PyMine/__pycache__/MineButton.cpython-36.pyc and b/PyMine/__pycache__/MineButton.cpython-36.pyc differ diff --git a/PyMine/__pycache__/PyCounter.cpython-36.pyc b/PyMine/__pycache__/PyCounter.cpython-36.pyc index 69ad467b88d4768ea3478bca0d47877af4b41f11..5ec6c356669907bedd46cceffe93522569dc7ef8 100644 Binary files a/PyMine/__pycache__/PyCounter.cpython-36.pyc and b/PyMine/__pycache__/PyCounter.cpython-36.pyc differ diff --git a/PyMine/__pycache__/WinFrame.cpython-36.pyc b/PyMine/__pycache__/WinFrame.cpython-36.pyc index fb8948ddaf230bf8a323268c02ba3a64930a6938..e05b4c08b8eeb08efc2682d77504330f22c4142b 100644 Binary files a/PyMine/__pycache__/WinFrame.cpython-36.pyc and b/PyMine/__pycache__/WinFrame.cpython-36.pyc differ