Permalink
Browse files

Move version to Shadow.py

  • Loading branch information...
1 parent d0cf23e commit 34f0f432346f9ab1d37bc9637c407d18be991079 @robertwb robertwb committed Oct 3, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 Cython/Shadow.py
  2. +1 −1 Cython/__init__.py
View
@@ -1,4 +1,5 @@
# cython.* namespace for pure mode.
+__version__ = "0.18-pre"
compiled = False
View
@@ -1,4 +1,4 @@
-__version__ = "0.18-pre"
+# __version__ defined in Shadow.py
# Void cython.* directives (for case insensitive operating systems).
from Cython.Shadow import *

2 comments on commit 34f0f43

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.

Contributor

robertwb replied Oct 4, 2012

Please sign in to comment.