Skip to content

Commit

Permalink
Fix Flake8 "F821 undefined name" error
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioburdisso committed May 13, 2020
1 parent 4d00476 commit f09989b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyss3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,8 @@ def is_a_collection(o):
"""Return True when the object ``o`` is a collection."""
from sys import version_info
py2 = version_info[0] == 2
if not py2:
basestring = None # to avoid the Flake8 "F821 undefined name" error
return hasattr(o, "__getitem__") and ((py2 and not isinstance(o, basestring)) or
(not py2 and not isinstance(o, (str, bytes))))

Expand Down

0 comments on commit f09989b

Please sign in to comment.