From ccb206826cd1784990f874eb81073f05d720b48b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 14 Sep 2018 06:12:40 -0700 Subject: Remove unnecessary binary_type compatibility shim The bytes type is available on all supported Pythons. Can remove workaround and make the code more forward compatible with Python 3. --- dateutil/parser/_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dateutil/parser/_parser.py') diff --git a/dateutil/parser/_parser.py b/dateutil/parser/_parser.py index 9d2bb79..044466d 100644 --- a/dateutil/parser/_parser.py +++ b/dateutil/parser/_parser.py @@ -40,7 +40,7 @@ from calendar import monthrange from io import StringIO import six -from six import binary_type, integer_types, text_type +from six import integer_types, text_type from decimal import Decimal @@ -63,7 +63,7 @@ class _timelex(object): if six.PY2: # In Python 2, we can't duck type properly because unicode has # a 'decode' function, and we'd be double-decoding - if isinstance(instream, (binary_type, bytearray)): + if isinstance(instream, (bytes, bytearray)): instream = instream.decode() else: if getattr(instream, 'decode', None) is not None: -- cgit v1.2.1