diff --git a/deimport/__init__.py b/deimport/__init__.py new file mode 100644 index 0000000..bbbc827 --- /dev/null +++ b/deimport/__init__.py @@ -0,0 +1 @@ +from deimport import deimport \ No newline at end of file diff --git a/_version.py b/deimport/_version.py similarity index 86% rename from _version.py rename to deimport/_version.py index ac5c9a0..d387c2f 100644 --- a/_version.py +++ b/deimport/_version.py @@ -4,4 +4,4 @@ # __version__ = f"0.0.3.dev1.{build_time}" # print(__version__) -__version__= "0.3.1.19" +__version__= "0.3.1.24" diff --git a/deimport.py b/deimport/deimport.py similarity index 83% rename from deimport.py rename to deimport/deimport.py index 1ec1ecf..3d99889 100644 --- a/deimport.py +++ b/deimport/deimport.py @@ -1,7 +1,15 @@ import sys # https://stackoverflow.com/questions/32234156/how-to-unimport-a-python-module-which-is-already-imported +#cheap hack to update frames def deimport(module_object=None,module=None,verbose=False): + try: + _deimport(module_object,module,verbose) + _deimport(module_object,module,verbose) + except: + _deimport(module_object,module,verbose) + +def _deimport(module_object=None,module=None,verbose=False): if module==None: module=module_object.__name__ if verbose: diff --git a/setup.py b/setup.py index 4038c5d..dba2a02 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ # https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56 from setuptools import setup, find_packages -from _version import __version__ +from deimport._version import __version__ setup( name="deimport",