Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsML committed Aug 25, 2021
1 parent f8d1bfd commit 6dcb1f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions deimport/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from deimport import deimport
2 changes: 1 addition & 1 deletion _version.py → deimport/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# __version__ = f"0.0.3.dev1.{build_time}"
# print(__version__)

__version__= "0.3.1.19"
__version__= "0.3.1.24"
8 changes: 8 additions & 0 deletions deimport.py → deimport/deimport.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6dcb1f3

Please sign in to comment.