Issue 22200: Remove distutils checks for Python version (original) (raw)

Issue22200

Created on 2014-08-14 21:37 by takluyver, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rm-distutils-version-check.patch takluyver,2014-08-14 21:37 review
Messages (5)
msg225320 - (view) Author: Thomas Kluyver (takluyver) * Date: 2014-08-14 21:37
We noticed the other day that distutils, despite being part of the standard library, checks the version of Python it's running under and has some different code paths - one of which is only taken for Python < 2.2. We haven't managed to figure out why this is necessary. So this issue is partly a patch and partly a question: is there a reason that distutils can't assume it's run on the version of Python it came with? If so, I'm happy to make a new patch adding a comment to explain that. If not, I'll go looking for other places where it has unnecessary checks, and we can clean up one little corner of wtf.
msg225481 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-18 04:01
New changeset fbb51251eb9d by Benjamin Peterson in branch '3.4': remove 2.2 and 2.6 compat code (closes #22200) http://hg.python.org/cpython/rev/fbb51251eb9d New changeset 66c7f30fe8c7 by Benjamin Peterson in branch 'default': merge 3.4 (closes #22200) http://hg.python.org/cpython/rev/66c7f30fe8c7
msg225786 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-08-24 01:50
There are other checks: Lib/distutils/command/build_ext.py: # this keeps compatibility from 2.3 to 2.5 if sys.version < "2.6": USER_BASE = None HAS_USER_SITE = False else: from site import USER_BASE HAS_USER_SITE = True Lib/distutils/msvccompiler.py and Lib/distutils/msvc9compiler.py: def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ ... if i == -1: return 6 Lib/distutils/tests/test_build_ext.py: class BuildExtTestCase(TempdirManager, LoggingSilencer, unittest.TestCase): def setUp(self): ... if sys.version > "2.6": ... def tearDown(self): ... if sys.version > "2.6":
msg225912 - (view) Author: Thomas Kluyver (takluyver) * Date: 2014-08-26 08:27
I spotted a few others as well. When I get a bit less busy in a couple of weeks time, I intend to go through and make a bigger patch to clean things up.
msg226511 - (view) Author: Thomas Kluyver (takluyver) * Date: 2014-09-06 20:01
I've made a patch removing some more of these version checks in issue 22349.
History
Date User Action Args
2022-04-11 14:58:07 admin set github: 66396
2014-09-07 10:30:23 berker.peksag set status: open -> closedresolution: fixedstage: resolved
2014-09-06 20:01:03 takluyver set messages: +
2014-08-26 08:27:00 takluyver set messages: +
2014-08-24 01:52:54 Arfrever set nosy: + benjamin.peterson
2014-08-24 01:50:28 Arfrever set status: closed -> openversions: + Python 3.4nosy: + Arfrevermessages: + resolution: fixed -> (no value)stage: resolved -> (no value)
2014-08-18 04:01:46 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: patch review -> resolved
2014-08-15 11:30:01 berker.peksag set stage: patch reviewtype: enhancementversions: + Python 3.5
2014-08-15 00:04:19 Aaron.Meurer set nosy: + Aaron.Meurer
2014-08-14 21:37:01 takluyver create