Skip to content

Commit

Permalink
[init] Add py deprecation warning
Browse files Browse the repository at this point in the history
Related to issue G-Node#387
  • Loading branch information
mpsonntag committed Apr 27, 2020
1 parent 4a3e56b commit 10c092b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion odml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def _format_warning(warn_msg, *args, **kwargs):
# Monkey patch formatting 'warnings' messages for the whole module.
warnings.formatwarning = _format_warning

if _python_version.major < 3 or _python_version.major == 3 and _python_version.minor < 6:
if _python_version.major < 3:
msg = "Python 2 has been deprecated.\n\todML support for Python 2 will be dropped August 2020."
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
elif _python_version.major == 3 and _python_version.minor < 6:
msg = "The '%s' package is not tested with your Python version. " % __name__
msg += "\n\tPlease consider upgrading to the latest Python distribution."
warnings.warn(msg)
Expand Down

0 comments on commit 10c092b

Please sign in to comment.