Skip to content

Commit aaea543

Browse files
authored
Merge dc4d099 into e9cfa1b
2 parents e9cfa1b + dc4d099 commit aaea543

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

source/gui/__init__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -889,19 +889,13 @@ class ExecAndPump(threading.Thread):
889889
"""Executes the given function with given args and kwargs in a background thread while blocking and pumping in the current thread."""
890890

891891
def __init__(self,func,*args,**kwargs):
892-
if hasattr(func, "__qualname__"): # _FuncPtr doesn't have this
893-
if hasattr(func, "__func__"):
894-
fname = func.__func__.__module__
895-
else:
896-
fname = func.__module__
897-
fname += f".{func.__qualname__}"
898-
else:
899-
fname = repr(func)
900-
self.name = f"{self.__class__.__module__}.{self.__class__.__qualname__}({fname})"
901892
self.func=func
902893
self.args=args
903894
self.kwargs=kwargs
904-
super(ExecAndPump,self).__init__()
895+
fname = repr(func)
896+
super().__init__(
897+
name= f"{self.__class__.__module__}.{self.__class__.__qualname__}({fname})"
898+
)
905899
self.threadExc=None
906900
self.start()
907901
time.sleep(0.1)

source/watchdog.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,7 @@ def __init__(self):
257257
self.isUsable = True
258258

259259
def execute(self, func, *args, pumpMessages=True, **kwargs):
260-
if hasattr(func, "__qualname__"): # _FuncPtr doesn't have this
261-
if hasattr(func, "__func__"):
262-
fname = func.__func__.__module__
263-
else:
264-
fname = func.__module__
265-
fname += f".{func.__qualname__}"
266-
else:
267-
fname = repr(func)
260+
fname = repr(func)
268261
self.name = f"{self.__class__.__module__}.{self.execute.__qualname__}({fname})"
269262
# Don't even bother making the call if the core is already dead.
270263
if isAttemptingRecovery:

0 commit comments

Comments
 (0)