Skip to content

Commit

Permalink
init.py relative import for HOC - PEP328 (#1267)
Browse files Browse the repository at this point in the history
* Update __init__.py
* resolve clashes when `hoc` folders are found in path
* docs conf.py - drop `hoc` clash workaround
  • Loading branch information
alexsavulescu committed Jan 28, 2022
1 parent 9077575 commit c133e6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,3 @@ def setup(app):

# Execute & convert notebooks + doxygen
subprocess.run("cd .. && python setup.py docs", check=True, shell=True)

# Remove `docs` from sys.path since RTD adds it automatically.
# Otherwise `docs/hoc` will clash with `hoc` when importing neuron
try:
sys.path.remove(os.path.abspath('.'))
except:
pass
2 changes: 1 addition & 1 deletion share/lib/python/neuron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
pass

try:
import hoc
from . import hoc
except:
try:
#Python3.1 extending needs to look into the module explicitly
Expand Down

0 comments on commit c133e6e

Please sign in to comment.