Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BLD: Fix some bugs in setupext.py #9510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
BLD: Fix has_include_file side-effect
The passed argument would be modified by function while it not designed to.
  • Loading branch information
Kojoley committed Nov 1, 2017
commit d527a82995b5bf51e270e17759820d4aab8f251a
3 changes: 2 additions & 1 deletion 3 setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def has_include_file(include_dirs, filename):
directories in `include_dirs`.
"""
if sys.platform == 'win32':
include_dirs += os.environ.get('INCLUDE', '.').split(';')
include_dirs = list(include_dirs) # copy before modify
include_dirs += os.environ.get('INCLUDE', '.').split(os.pathsep)
Copy link
Contributor

Choose a reason for hiding this comment

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

probably worth clarifying in a comment? I would have missed the point of the change if not for the commit message...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also concerned about the change from split(';') to split(os.pathsep). Those are not the same, but there's nothing indicating the rationale behind them.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dopplershift os.pathsep == ; on windows https://docs.python.org/2/library/os.html#os.pathsep

Visual C++ 2015 x64 Native Build Tools Command Prompt
C:\Program Files (x86)\Microsoft Visual C++ Build Tools>set INCLUDE
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared;C:\Program Files(x86)\Windows Kits\10\include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt;

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops. 🐑 Thanks for clarifying.

for dir in include_dirs:
if os.path.exists(os.path.join(dir, filename)):
return True
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.