diff --git a/changelog.d/963.bugfix.rst b/changelog.d/963.bugfix.rst new file mode 100644 index 000000000..2b1aabc0c --- /dev/null +++ b/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. diff --git a/dateutil/tz/tz.py b/dateutil/tz/tz.py index 9d64c37a9..2460b5ed5 100644 --- a/dateutil/tz/tz.py +++ b/dateutil/tz/tz.py @@ -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): """