Skip to content

Commit

Permalink
restored sys modules after import
Browse files Browse the repository at this point in the history
  • Loading branch information
anjsudh committed Dec 25, 2018
1 parent 435923e commit 5933d5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/core/computation/check.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from distutils.version import LooseVersion
import warnings

Expand All @@ -6,10 +7,12 @@
_NUMEXPR_VERSION = None

try:
modules = sys.modules.copy()
import numexpr as ne
ver = LooseVersion(ne.__version__)
_NUMEXPR_INSTALLED = ver >= LooseVersion(_MIN_NUMEXPR_VERSION)
_NUMEXPR_VERSION = ver
sys.modules = modules

if not _NUMEXPR_INSTALLED:
warnings.warn(
Expand All @@ -21,4 +24,4 @@
except ImportError: # pragma: no cover
pass

__all__ = ['_NUMEXPR_INSTALLED']
__all__ = ['_NUMEXPR_INSTALLED', '_NUMEXPR_VERSION']

0 comments on commit 5933d5e

Please sign in to comment.