[Python-Dev] Those import related syntax errors again...

Mark Hammond MarkH@ActiveState.com
Tue, 20 Feb 2001 23:12:23 +1100

Hi all,
	I'm a little confused by the following exception:

  File "f:\src\python-cvs\xpcom\server\policy.py", line 18, in ?
    from xpcom import xpcom_consts, _xpcom, client, nsError,
ServerException, COMException

exceptions.SyntaxError: BuildInterfaceInfo: exec or 'import *' makes names
ambiguous in nested scope (__init__.py, line 71)

This sounds alot like Tim's question on this a while ago, and from all
accounts this had been resolved
(http://mail.python.org/pipermail/python-dev/2001-February/012456.html)  In
that mail, Jeremy writes:

-- quote --
>     from Percolator import Percolator
> in a class definition.  That smells like a bug, not a debatable design
> choice.

Percolator has "from x import *" code. This is what is causing the
exception. I think it has already been fixed in CVS though, so should
work again.
-- end quote --

However, Tim replied saying that it still didn't work for him.  There was
never a followup saying "it does now".

In this case, the module being imported from does _not_ use "from module
import *" at all, but is a parent package.  The only name referenced by the
__init__ function is "ServerException", and that is a simple class.  The
only "import *" I can track is via the name "client", which is itself a
package and does the "import *" about 3 modules deep.

Any clues?