Fix regex match and decoding in install.py
- Changed the regex match to search for bytes instead of string. - Added a condition to decode the pythonCmd only if no error occurred.
This commit is contained in:
parent
a5eaa6ec17
commit
ffeb632ec6
@ -149,7 +149,7 @@ def virtualenv_create_venv(pythoncmd, venvdir, envname):
|
||||
return False
|
||||
|
||||
def extract_actual_location(text):
|
||||
match = re.search(r'Actual location:\s+"(.*?)"', text)
|
||||
match = re.search(rb'Actual location:\s+"(.*?)"', text)
|
||||
if match:
|
||||
return match.group(1)
|
||||
else:
|
||||
@ -193,6 +193,8 @@ def virtualenv_create_venv(pythoncmd, venvdir, envname):
|
||||
print('create env failed')
|
||||
print(error)
|
||||
return False
|
||||
else:
|
||||
pythonCmd = pythonCmd.decode()
|
||||
return pythonCmd
|
||||
except Exception as error:
|
||||
print('create env failed')
|
||||
|
Loading…
x
Reference in New Issue
Block a user