Skip to content

Commit

Permalink
wdev.py: cope with slightly different output from py -0.
Browse files Browse the repository at this point in the history
A recent run on a Github windows machine had `py -0` output lines without `V:`.
  • Loading branch information
julian-smith-artifex-com committed Apr 16, 2024
1 parent 872f44d commit 915b3c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions wdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,19 @@ def __init__( self, cpu=None, version=None, verbose=True):
text = subprocess.check_output( command, shell=True, text=True)
for line in text.split('\n'):
#_log( f' {line}')
m = re.match( '^ *-V:([0-9.]+)(-32)? ([*])? +(.+)$', line)
m = re.match( '^ *-(V:)?([0-9.]+)(-32)? ([*])? +(.+)$', line)
if not m:
if verbose:
_log( f'No match for {line=}')
_log( f'Does not match: {line=}')
continue
version2 = m.group(1)
bits = 32 if m.group(2) else 64
current = m.group(3)
version2 = m.group(2)
bits = 32 if m.group(3) else 64
current = m.group(4)
if verbose:
_log( f'{version2=} {bits=} from {line=}.')
if bits != cpu.bits or version2 != version:
continue
path = m.group(4).strip()
path = m.group(5).strip()
root = path[ :path.rfind('\\')]
if not os.path.exists(path):
# Sometimes it seems that the specified .../python.exe does not exist,
Expand Down

0 comments on commit 915b3c4

Please sign in to comment.