FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-85454: Remove distutils.ccompiler from Tools/c-analyzer by corona10 · Pull Request #95171 · python/cpython · GitHub

Repository navigation

gh-85454: Remove distutils.ccompiler from Tools/c-analyzer - #95171

Merged
tiran merged 1 commit into
python:mainfrom
corona10:gh-85454-c-analyzer
Jul 25, 2022
Merged

tiran merged 1 commit into
python:mainfrom
corona10:gh-85454-c-analyzer

Conversation

corona10 commented Jul 23, 2022 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

}


def _get_default_compiler():

corona10 Jul 23, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minimalized ported version from

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'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It may be worth having a short comment indicating this was derived from the distutils code.



def _get_default_compiler():
if re.match('cygwin.*', sys.platform) is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You can just remove cygwin as it is unsupported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Are you sure?

corona10 Jul 24, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cygwin is certainly still alive to some extent, so I'd say let's not worry about that in the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

corona10 Jul 26, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL