GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-85454: Remove distutils.ccompiler from Tools/c-analyzer by corona10 · Pull Request #95171 · python/cpython Conversation
|
| } | ||
|
|
||
|
|
||
| def _get_default_compiler(): |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Minimalized ported version from
cpython/Lib/distutils/ccompiler.py
Lines 937 to 956 in f4c0348
| def get_default_compiler(osname=None, platform=None): | |
| """Determine the default compiler to use for the given platform. | |
| osname should be one of the standard Python OS names (i.e. the | |
| ones returned by os.name) and platform the common value | |
| returned by sys.platform for the platform in question. | |
| The default values are os.name and sys.platform in case the | |
| parameters are not given. | |
| """ | |
| if osname is None: | |
| osname = os.name | |
| if platform is None: | |
| platform = sys.platform | |
| for pattern, compiler in _default_compilers: | |
| if re.match(pattern, platform) is not None or \ | |
| re.match(pattern, osname) is not None: | |
| return compiler | |
| # Default to Unix compiler | |
| return 'unix' |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It may be worth having a short comment indicating this was derived from the distutils code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
|
|
||
| def _get_default_compiler(): | ||
| if re.match('cygwin.*', sys.platform) is not None: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You can just remove cygwin as it is unsupported.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are you sure?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We have a bunch of Cygwin-related codes (__CYGWIN__) in CPython code base, Did we decide to remove them?
Even if PEP 11 defined tier-based platforms, I don't interpret them as removing all unsupported platform codes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cygwin is certainly still alive to some extent, so I'd say let's not worry about that in the PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you remove cygwin branch, it will fallback to unix which is better than special casing it but it's minor and you can ignore this too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you remove cygwin branch, it will fallback to unix which is better than special casing it but it's minor and you can ignore this too.
It's care about Windows/Cygwin case, see: https://docs.python.org/3/library/sys.html.
It can be gone to the wrong fallback logic.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.