Skip to content

Commit f614ab9

Browse files
committed
fix: decorator and ref: check name
1 parent cf72c26 commit f614ab9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

nipype/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ def decorator(func):
6565
if condition:
6666
return func
6767
else:
68-
return functools.lru_cache(func)
68+
return functools.lru_cache()(func)
6969
return decorator
7070

7171

7272
@sys_based_cache(sys.version_info < (3,))
73-
def check_version(raise_exception=False):
73+
def check_latest_version(raise_exception=False):
7474
"""Check for the latest version of the library
7575
7676
parameters:
@@ -105,10 +105,10 @@ def check_version(raise_exception=False):
105105
raise RuntimeError(message)
106106
else:
107107
logger.critical(message)
108-
108+
return latest
109109

110110
# Run telemetry on import for interactive sessions, such as IPython, Jupyter notebooks, Python REPL
111111
if config.getboolean('execution', 'check_version'):
112112
import __main__
113113
if not hasattr(__main__, '__file__'):
114-
check_version()
114+
check_latest_version()

nipype/interfaces/base/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class BaseInterface(Interface):
170170
def __init__(self, from_file=None, resource_monitor=None,
171171
ignore_exception=False, **inputs):
172172
if config.getboolean('execution', 'check_version'):
173-
from ... import check_version
174-
check_version()
173+
from ... import check_latest_version
174+
check_latest_version()
175175

176176
if not self.input_spec:
177177
raise Exception(

nipype/pipeline/engine/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def __init__(self, name=None, base_dir=None):
4242
self.base_dir = base_dir
4343
self.config = deepcopy(config._sections)
4444
if config.getboolean('execution', 'check_version'):
45-
from ... import check_version
46-
check_version()
45+
from ... import check_latest_version
46+
check_latest_version()
4747

4848
@property
4949
def name(self):

0 commit comments

Comments
 (0)