Skip to content

Commit

Permalink
Merge pull request #963 from pganssle/contextlib_import
Browse files Browse the repository at this point in the history
Fix incorrect import in Python 3.7+
  • Loading branch information
pganssle committed Sep 27, 2019
2 parents 22b43cb + 980e5aa commit 6c7719b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog.d/963.bugfix.rst
@@ -0,0 +1,2 @@
Fixed issue where ``dateutil.tz`` was using a backport of ``contextlib.nullcontext``
even in Python 3.7 due to a malformed import statement.
2 changes: 1 addition & 1 deletion dateutil/tz/tz.py
Expand Up @@ -1823,7 +1823,7 @@ def _get_supported_offset(second_offset):

try:
# Python 3.7 feature
from contextmanager import nullcontext as _nullcontext
from contextlib import nullcontext as _nullcontext
except ImportError:
class _nullcontext(object):
"""
Expand Down

0 comments on commit 6c7719b

Please sign in to comment.