Skip to content

Commit

Permalink
Merge pull request #1442 from brian-team/Remove-distutils
Browse files Browse the repository at this point in the history
Replace deprecated distutils package
  • Loading branch information
mstimberg authored Nov 16, 2022
2 parents cfd5da8 + 58ecd16 commit 4886c46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions brian2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _check_dependencies():

# Check for outdated dependency versions
def _check_dependency_version(name, version):
from distutils.version import LooseVersion
from packaging.version import Version
from .core.preferences import prefs
from .utils.logger import get_logger
import sys
Expand All @@ -82,7 +82,7 @@ def _check_dependency_version(name, version):
module = sys.modules[name]
if not isinstance(module.__version__, str): # mocked module
return
if not LooseVersion(module.__version__) >= LooseVersion(version):
if not Version(module.__version__) >= Version(version):
message = f'{name} is outdated (got version {module.__version__}, need version {version})'
if prefs.core.outdated_dependency_error:
raise ImportError(message)
Expand Down

0 comments on commit 4886c46

Please sign in to comment.