From c133e6ef661ee8eab60bfd60e68c9d1a529ccaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20S=C4=83vulescu?= Date: Tue, 11 May 2021 20:50:44 +0200 Subject: [PATCH] init.py relative import for HOC - PEP328 (#1267) * Update __init__.py * resolve clashes when `hoc` folders are found in path * docs conf.py - drop `hoc` clash workaround --- docs/conf.py | 7 ------- share/lib/python/neuron/__init__.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 31268e9a38..bb0478c983 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 \ No newline at end of file diff --git a/share/lib/python/neuron/__init__.py b/share/lib/python/neuron/__init__.py index f635063f5d..dcc8d71763 100644 --- a/share/lib/python/neuron/__init__.py +++ b/share/lib/python/neuron/__init__.py @@ -130,7 +130,7 @@ pass try: - import hoc + from . import hoc except: try: #Python3.1 extending needs to look into the module explicitly