File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -422,8 +422,6 @@ def register_readline():
422422
423423 sys .__interactivehook__ = register_readline
424424
425- CONFIG_LINE = r'^(?P<key>(\w|[-_])+)\s*=\s*(?P<value>.*)\s*$'
426-
427425def venv (known_paths ):
428426 global PREFIXES , ENABLE_USER_SITE
429427
@@ -445,19 +443,16 @@ def venv(known_paths):
445443 ]
446444
447445 if candidate_confs :
448- import re
449- config_line = re .compile (CONFIG_LINE )
450446 virtual_conf = candidate_confs [0 ]
451447 system_site = "true"
452448 # Issue 25185: Use UTF-8, as that's what the venv module uses when
453449 # writing the file.
454450 with open (virtual_conf , encoding = 'utf-8' ) as f :
455451 for line in f :
456- line = line .strip ()
457- m = config_line .match (line )
458- if m :
459- d = m .groupdict ()
460- key , value = d ['key' ].lower (), d ['value' ]
452+ if '=' in line :
453+ key , _ , value = line .partition ('=' )
454+ key = key .strip ().lower ()
455+ value = value .strip ()
461456 if key == 'include-system-site-packages' :
462457 system_site = value .lower ()
463458 elif key == 'home' :
You can’t perform that action at this time.
0 commit comments