-2

Im getting this stack trace:

  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/flow_conditions.py", line 3, in <module>
    from gitflow.flow_config import ConfigManager
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/flow_config.py", line 19, in <module>
    from gitflow.flow_workflow import FlowCommand, WorkflowCommand
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/flow_workflow.py", line 5, in <module>
    from gitflow.flow_conditions import ConditionFactory
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/flow_conditions.py", line 3, in <module>
    from gitflow.flow_config import ConfigManager
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/flow_config.py", line 19, in <module>
    from gitflow.flow_workflow import FlowCommand, WorkflowCommand
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/flow_workflow.py", line 5, in <module>
    from gitflow.flow_conditions import ConditionFactory
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/flow_conditions.py", line 3, in <module>
    from gitflow.flow_config import ConfigManager
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/flow_config.py", line 19, in <module>
    from gitflow.flow_workflow import FlowCommand, WorkflowCommand
  File "/usr/lib/python2.7/site-packages/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/gitflow/flow_workflow.py", line 5, in <module>
    from gitflow.flow_conditions import ConditionFactory
  File "/usr/lib/python2.7/site-packages/gitflow/flow_conditions.py", line 3, in <module>

I can't find a thing wrong with my code and it leaves me to an idea that I wasn't sure was a problem in Python. Circular dependencies. Does python handle circular dependencies well or should I refactor them out to see if that solves the problem.

thanks.

4

1 回答 1

4

如果你有这个:

# in foo.py
from bar import cat

# in bar.py
from foo import dog

这会创建两个模块尝试相互导入的无限循环。Python 没有专门处理这个问题,因为人们普遍认为循环依赖是糟糕设计的标志。

于 2013-10-11T14:57:39.853 回答