Skip to content

Commit

Permalink
get_resources: add reload=True
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Dec 6, 2020
1 parent 2da9d9b commit 08e22b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions niftypet/ninst/cudasetup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env python
"""Tools for CUDA compilation and set-up for Python 3."""
import importlib
import logging
import os

# from pkg_resources import resource_filename
import platform
import re
import shutil
import sys
from distutils.sysconfig import get_python_inc
from textwrap import dedent

# from pkg_resources import resource_filename
try:
from numpy import get_include as get_numpy_inc
except ImportError:
Expand Down Expand Up @@ -168,7 +168,7 @@ def resources_setup(gpu=True):
return dev_setup() if gpu else ""


def get_resources(sys_append=True):
def get_resources(sys_append=True, reload=True):
path_resources = path_niftypet_local()
if sys_append:
if path_resources not in sys.path:
Expand All @@ -189,4 +189,4 @@ def get_resources(sys_append=True):
)
raise
else:
return resources
return importlib.reload(resources) if reload else resources

0 comments on commit 08e22b7

Please sign in to comment.