Skip to content

Commit

Permalink
Use base64.decodebytes only in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tirkarthi committed May 17, 2020
1 parent fa587d1 commit 7798957
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions feedparser/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ class request(object):
from .datetimes import _parse_date
from .urls import convert_to_idn

# Python 3.1 deprecated decodestring in favor of decodebytes.
# This can be removed after Python 2.7 support is dropped.
try:
_base64decode = base64.decodebytes
except AttributeError:
_base64decode = base64.decodestring
_base64decode = base64.decodebytes

try:
basestring
Expand Down
7 changes: 1 addition & 6 deletions feedparser/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@
from .urls import _urljoin, make_safe_absolute_uri, resolve_relative_uris


# Python 2.7 only offers "decodestring()".
# This name substitution can be removed when Python 2.7 support is dropped.
try:
_base64decode = base64.decodebytes
except AttributeError:
_base64decode = base64.decodestring
_base64decode = base64.decodebytes


bytes_ = type(b'')
Expand Down

0 comments on commit 7798957

Please sign in to comment.