Skip to content

Commit

Permalink
Use try/except when assigning msc_ver.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Oct 29, 2022
1 parent c5f0b27 commit 6c39b50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions distutils/cygwinccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def get_msvcr():
with MSVC 7.0 or later.
"""
match = re.search(r'MSC v\.(\d{4})', sys.version)
if not match:
try:
msc_ver = int(match.group(1))
except AttributeError:
return

msc_ver = int(match.group(1))
try:
return _msvcr_lookup[msc_ver]
except KeyError:
Expand Down

0 comments on commit 6c39b50

Please sign in to comment.