• Thomas Wouters's avatar
    - Add new Warning class, ImportWarning · 9df4e6f6
    Thomas Wouters yazdı
     - Warn-raise ImportWarning when importing would have picked up a directory
       as package, if only it'd had an __init__.py. This swaps two tests (for
       case-ness and __init__-ness), but case-test is not really more expensive,
       and it's not in a speed-critical section.
    
     - Test for the new warning by importing a common non-package directory on
       sys.path: site-packages
    
     - In regrtest.py, silence warnings generated by the build-environment
       because Modules/ (which is added to sys.path for Setup-created modules)
       has 'zlib' and '_ctypes' directories without __init__.py's.
    9df4e6f6
test_import.py 6.24 KB