Skip to content

Commit

Permalink
Move version to Shadow.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwb committed Oct 3, 2012
1 parent d0cf23e commit 34f0f43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cython/Shadow.py
@@ -1,4 +1,5 @@
# cython.* namespace for pure mode. # cython.* namespace for pure mode.
__version__ = "0.18-pre"


compiled = False compiled = False


Expand Down
2 changes: 1 addition & 1 deletion Cython/__init__.py
@@ -1,4 +1,4 @@
__version__ = "0.18-pre" # __version__ defined in Shadow.py


# Void cython.* directives (for case insensitive operating systems). # Void cython.* directives (for case insensitive operating systems).
from Cython.Shadow import * from Cython.Shadow import *

2 comments on commit 34f0f43

@cpcloud
Copy link

@cpcloud cpcloud commented on 34f0f43 Oct 4, 2012

Choose a reason for hiding this comment

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

I cannot install Cython master after this change. Creating a simple simluation of this problem in Bash as follows:

mkdir testpkg
echo "from testpkg.testscript import *" > testpkg/__init__.py
echo "__version__ = '23059'" > testpkg/testscript.py
python -c 'import testpkg; print testpkg.__version__'

gives AttributeError: 'module' object has no attribute '__version__'

If you look here you'll see in section 6.1 that "This imports all names except those beginning with an underscore (_)." "This" being statements of the form from module import *. So this change breaks installation because

from Cython.Shadow import *

imports only those objects not beginning with __.

Also the error message saying that one probably needs a pure Python version of Cython because a module attribute is not accessible seems a bit uninformative and may even seem like cause for alarm for the novice user.

A simple stack trace (which is given) is just as informative and probably wouldn't seem as confusing to a novice.

@robertwb
Copy link
Contributor Author

@robertwb robertwb commented on 34f0f43 Oct 4, 2012 via email

Choose a reason for hiding this comment

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

Please sign in to comment.