diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-29 03:31:22 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-29 03:31:22 -0400 |
| commit | 855475e32cd41310774d8ebe90fd7a1a08ddddbc (patch) | |
| tree | 6f201ff05345e52749ae9318b436e51ba8202b7a | |
| parent | ff69195b9b05de58f3fc4ff956bbe5dad31be444 (diff) | |
| download | python-setuptools-git-855475e32cd41310774d8ebe90fd7a1a08ddddbc.tar.gz | |
Prefer partition to find.
| -rw-r--r-- | distutils/cygwinccompiler.py | 6 |
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'] |
