Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Fix circular dependend import #343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix circular dependend import #343

wants to merge 1 commit into from

Conversation

onur
Copy link

@onur onur commented Jun 20, 2015

Python3 is givin an error when we try to import gumbo1:

ImportError: No module named 'gumboc_tags'

This is because init.py is importing everything and gumboc_tags
already imported.

This patch is fixing this issue.

Python3 is givin an error when we try to import gumbo[1]:

    ImportError: No module named 'gumboc_tags'

This is because __init__.py is importing everything and gumboc_tags
already imported.

This patch is fixing this issue.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=789299
@nostrademons
Copy link
Contributor

Travis is giving a test failure for this - it looks like it breaks Python 2?

Maybe try "from . import gumboc_tags" - I've seen this fix similar errors on other projects?

@onur
Copy link
Author

onur commented Jun 20, 2015

It's just breaking tests because PYTHONPATH is not defined. from . import gumboc_tags might be a better solution for this.

@fake-name
Copy link

from . import gumboc_tags does not work:

>>> import gumbo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/gumbo/__init__.py", line 33, in <module>
    from gumbo.gumboc import *
  File "/usr/local/lib/python3.4/dist-packages/gumbo/gumboc.py", line 29, in <module>
    from . import gumboc_tags
ImportError: cannot import name 'gumboc_tags'


Actually, the patch doesn't work either:

>>> import gumbo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/gumbo/__init__.py", line 33, in <module>
    from gumbo.gumboc import *
  File "/usr/local/lib/python3.4/dist-packages/gumbo/gumboc.py", line 29, in <module>
    from gumboc import gumboc_tags
ImportError: No module named 'gumboc'

No idea why. I'm having library path issues, but I'm not sure how that interacts here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants