Repository: nvaccess/nvda

Issue:
Current alpha nap cannot create portable version


auto or manually update the alpha snap, and download the file. Select  install, in my case this is a portable version., so a portable install is what it should do. And respond to the prompts as normal.### Steps to reproduce:

### Actual behavior:
It loads in, and then fails to create the portable version with an error, leaving you in the  temporary running new snapshot.
The log error is:
entering wx application main loop
ERROR - gui.installerGui.doCreatePortable (09:47:32.418) - MainThread 
(4576):
Failed to create portable copy
Traceback (most recent call last):
  File "gui\installerGui.pyc", line 359, in doCreatePortable
  File "gui\__init__.pyc", line 900, in __init__
  File "threading.pyc", line 1077, in name
AssertionError: Thread.__init__() not called
IO - speech.speak (09:47:32.444) - MainThread (4576):
Speaking [LangChangeCommand ('en_GB'), 'Desktop  list']


### Expected behavior:
It should update and run after the update after a prompt to say it was successful
### System configuration
Windows 7 64 pro 
#### NVDA installed/portable/running from source:
Portable
#### NVDA version:
INFO - __main__ (09:59:12.267) - MainThread (1044):
Starting NVDA version alpha-18737,e9cfa1b1

That is the one downloaded.
Originally running an alpha snap...
INFO - __main__ (10:16:05.256):
Starting NVDA version alpha-18699,0e4bb4ad

#### Windows version:
7 64 pro
#### Name and version of other software in use when reproducing the issue:
None
#### Other information about your system:
8gig ram four core processor etc
### Other questions
#### Does the issue still occur after restarting your PC?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Well as its on install, no.


Discussion:

Resolving patch:
diff --git a/source/gui/__init__.py b/source/gui/__init__.py
--- a/source/gui/__init__.py
+++ b/source/gui/__init__.py
@@ -889,19 +889,13 @@ class ExecAndPump(threading.Thread):
 	"""Executes the given function with given args and kwargs in a background thread while blocking and pumping in the current thread."""
 
 	def __init__(self,func,*args,**kwargs):
-		if hasattr(func, "__qualname__"):  # _FuncPtr doesn't have this
-			if hasattr(func, "__func__"):
-				fname = func.__func__.__module__
-			else:
-				fname = func.__module__
-			fname += f".{func.__qualname__}"
-		else:
-			fname = repr(func)
-		self.name = f"{self.__class__.__module__}.{self.__class__.__qualname__}({fname})"
 		self.func=func
 		self.args=args
 		self.kwargs=kwargs
-		super(ExecAndPump,self).__init__()
+		fname = repr(func)
+		super().__init__(
+			name=f"{self.__class__.__module__}.{self.__class__.__qualname__}({fname})"
+		)
 		self.threadExc=None
 		self.start()
 		time.sleep(0.1)
diff --git a/source/watchdog.py b/source/watchdog.py
--- a/source/watchdog.py
+++ b/source/watchdog.py
@@ -257,14 +257,7 @@ def __init__(self):
 		self.isUsable = True
 
 	def execute(self, func, *args, pumpMessages=True, **kwargs):
-		if hasattr(func, "__qualname__"):  # _FuncPtr doesn't have this
-			if hasattr(func, "__func__"):
-				fname = func.__func__.__module__
-			else:
-				fname = func.__module__
-			fname += f".{func.__qualname__}"
-		else:
-			fname = repr(func)
+		fname = repr(func)
 		self.name = f"{self.__class__.__module__}.{self.execute.__qualname__}({fname})"
 		# Don't even bother making the call if the core is already dead.
 		if isAttemptingRecovery:


Test patch: