From 3d996e54e7be0ad9a9a2a6a3c58d9a0d661e839d Mon Sep 17 00:00:00 2001 From: Robin De Schepper Date: Sat, 20 Mar 2021 10:24:07 +0100 Subject: [PATCH] Changed comment and removed non-existing `nonlocal_hclass` import --- share/lib/python/neuron/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/lib/python/neuron/__init__.py b/share/lib/python/neuron/__init__.py index 80b0770a9a..79c3b0abf0 100644 --- a/share/lib/python/neuron/__init__.py +++ b/share/lib/python/neuron/__init__.py @@ -235,14 +235,14 @@ def test_rxd(exitOnError=True): import sys, types +# Load the `hclass` factory for the correct Python version 2/3 and prevent the +# incorrect module source code from being opened by creating an empty module. if sys.version_info[0] == 2: - from neuron.hclass2 import hclass - # Add hclass3, the py3 variant of hclass2 to the module cache so that hclass3.py - # is never read by the Python 2 interpreter and can contain Python 3 only syntax. sys.modules["neuron.hclass3"] = types.ModuleType("neuron.hclass3") + from neuron.hclass2 import hclass else: - from neuron.hclass3 import hclass, nonlocal_hclass sys.modules["neuron.hclass2"] = types.ModuleType("neuron.hclass2") + from neuron.hclass3 import hclass # global list of paths already loaded by load_mechanisms nrn_dll_loaded = []