Skip to content

Commit

Permalink
NEURON 8.0.x RXD node: backward compatible Callable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsavulescu committed Feb 1, 2022
1 parent 7774c0d commit ec8c7a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions share/lib/python/neuron/rxd/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
from .rxdException import RxDException
import warnings
import ctypes
import collections

# For 8.0.x release, keep backward compat with older python versions
try:
from collections.abc import Callable
except ImportError:
from collections import Callable


# function to change extracellular diffusion
set_diffusion = nrn_dll_sym("set_diffusion")
Expand Down Expand Up @@ -313,7 +319,7 @@ def include_flux(self, *args, **kwargs):
source[0]
except:
raise RxDException("HocObject must be a pointer")
elif len(args) == 1 and isinstance(args[0], collections.Callable):
elif len(args) == 1 and isinstance(args[0], Callable):
flux_type = 2
source = args[0]
warnings.warn(
Expand Down

0 comments on commit ec8c7a3

Please sign in to comment.