Message2045

Author tristanlk
Recipients
Date 2008-01-02.05:09:49
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
once some classes have been compiled (mainly __init__) they no longer work as expected.

example (sorry if this is hard to follow):

$ ls
demo.py  test
$ ls test/
down  __init__.py
$ ls test/down/
__init__.py
$ cat demo.py 
import test
import test.down
print test.__file__
print test.__path__
print test.down.__file__
print test.down.__path__
test.down.test()
$ cat test/__init__.py 
$ cat test/down/__init__.py 
import traceback
def test():
    traceback.print_stack()
$ jython demo.py 
test/__init__.py
['test']
test/down/__init__.py
['test/down']
  File "demo.py", line 7, in ?
    test.down.test()
  File "test/down/__init__.py", line 3, in test
    traceback.print_stack()
$ jython demo.py 
__init__.py
['test']
test/__init__.py
['test/down']
  File "demo.py", line 7, in ?
    test.down.test()
  File "test/__init__.py", line 3, in test

you'll notice the first run works fine (which is running from source), but the second time it fails (when it's trying to load from the $py.class).
History
Date User Action Args
2008-02-20 17:18:08adminlinkissue1861973 messages
2008-02-20 17:18:08admincreate