Skip to content

Refactor directives #324

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 4 commits into from
Jan 12, 2017
Merged

Conversation

vmuriart
Copy link
Contributor

Refactors all those pesky #if to simplify process of supporting newer python versions.

Theres a section in runtime I left untouched as it has many embbded directives.

Makes code more future proof as new python versions role out.

We could otherwise use !PYTHON27 but it could be confused as a patch specific
to that version of python instead of PYTHON3 compat.
Go with general convention
Not relevant after dropping Python 24, Python 25
Copy link
Contributor

@tonyroberts tonyroberts left a comment

Choose a reason for hiding this comment

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

much cleaner!

@vmuriart vmuriart merged commit 8972b15 into pythonnet:master Jan 12, 2017
@vmuriart vmuriart deleted the refactor_directives branch January 12, 2017 18:06
@den-run-ai
Copy link
Contributor

@vmuriart so now we need to use both python3 and python3x flags?

@filmor
Copy link
Member

filmor commented Jan 12, 2017

Yes. And .NET doesn't really have a way around that, AFAICT.

@den-run-ai
Copy link
Contributor

@vmuriart is it also possible to do this at the top of the file:

#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35)
#define PYTHON3
#endif

@vmuriart
Copy link
Contributor Author

It would be needed across every file that needs that directive. http://stackoverflow.com/questions/30350738/where-to-specify-preprocessor-directives-in-visual-studio

The project file is updated to have PYTHON2 set on it though, you would just need to update that on your build config to PYTHON3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants