-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Hello.
I tested pypreprocessor as following
In "py2and3.py"
import sys
from pypreprocessor import pypreprocessor
#exclude
if sys.version[:3].split('.')[0] == '2':
pypreprocessor.defines.append('python2')
if sys.version[:3].split('.')[0] == '3':
pypreprocessor.defines.append('python3')
pypreprocessor.parse()
#endexclude
from print_python_version import print_python_version
print_python_version()
In "print_python_version.py"
def print_python_version():
#ifdef python2
print('You are using Python 2x')
#else
#ifdef python3
print('You are using python 3x')
#else
print('Python version not supported')
#endifall
And the output of "python py2and3.py" is :
You are using Python 2x
You are using python 3x
Python version not supported
which means things such as #ifdef and #else are NOT effective in the file "print_python_version.py" anymore.
How can I make the macro effective all over the files in the project ?
Metadata
Metadata
Assignees
Labels
No labels