[Python-bugs-list] [ python-Bugs-597604 ] import cycle in distutils

noreply@sourceforge.net noreply@sourceforge.net
Mon, 19 Aug 2002 21:59:46 -0700


Bugs item #597604, was opened at 2002-08-19 22:59
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=597604&group_id=5470

Category: Distutils
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Dalke (dalke)
Assigned to: Nobody/Anonymous (nobody)
Summary: import cycle in distutils

Initial Comment:
There is a import cycle in distutils which causes
4Suite's setup.py
to fail.  Here's the reproducible, using 2.3a0 from CVS
(latest
updated on 18 Aug)

% python
Python 2.3a0 (#3, Aug 19 2002, 01:46:45)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> from distutils import dist
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/distutils/dist.py",
line 19, in ?
    from distutils.core import DEBUG
  File "/usr/local/lib/python2.3/distutils/core.py",
line 24, in ?
    from distutils.dist import Distribution
ImportError: cannot import name Distribution
>>>


However, I *can* do the following
% python
Python 2.3a0 (#3, Aug 19 2002, 01:46:45)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> from distutils import core
>>> from distutils import dist
>>>

This doesn't exist in Python 2.2.

The cycle is obvious -- 'dist' imports 'core' imports
DEBUG from 'dist'.

I tried replacing things with
  from distutils import core

and using core.DEBUG instead of DEBUG, but that
caused a problem with Python's install.  Hence, no
patch included.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=597604&group_id=5470