A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/008653.html below:

[Python-Dev] Looking for an "import" expert

[Python-Dev] Looking for an "import" expert [Python-Dev] Looking for an "import" expertTim Peters tim_one@email.msn.com
Mon, 21 Aug 2000 18:30:11 -0400
> ...
> What happens is that test_getopt.py has this near the top:
>
>     from test.test_support import verbose
>
> and this is causing *another* copy of the test_support module to
> get loaded, and *its* verbose attr is 1.

Maybe adding these lines after that import will help clarify it for you
(note that you can't print to stdout without screwing up what regrtest
expects):

import sys
print >> sys.stderr, sys.modules["test_support"], \
                     sys.modules["test.test_support"]

(hot *damn* is that more pleasant than pasting stuff together by hand!).

When I run it, I get

<module 'test_support' from '..\lib\test\test_support.pyc'>
<module 'test.test_support' from
    'C:\CODE\PYTHON\DIST\SRC\lib\test\test_support.pyc'>

so they clearly are distinct modules.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4