summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-10-29 03:31:22 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-10-29 03:31:22 -0400
commit855475e32cd41310774d8ebe90fd7a1a08ddddbc (patch)
tree6f201ff05345e52749ae9318b436e51ba8202b7a
parentff69195b9b05de58f3fc4ff956bbe5dad31be444 (diff)
downloadpython-setuptools-git-855475e32cd41310774d8ebe90fd7a1a08ddddbc.tar.gz
Prefer partition to find.
-rw-r--r--distutils/cygwinccompiler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/distutils/cygwinccompiler.py b/distutils/cygwinccompiler.py
index a23db4e1..2d3fd638 100644
--- a/distutils/cygwinccompiler.py
+++ b/distutils/cygwinccompiler.py
@@ -28,11 +28,11 @@ def get_msvcr():
"""Include the appropriate MSVC runtime library if Python was built
with MSVC 7.0 or later.
"""
- msc_pos = sys.version.find('MSC v.')
- if msc_pos == -1:
+ _, _, rest = sys.version.partition('MSC v.')
+ if not rest:
return
- msc_ver = sys.version[msc_pos + 6 : msc_pos + 10]
+ msc_ver = rest[:4]
if msc_ver == '1300':
# MSVC 7.0
return ['msvcr70']