Rearrange for flake8
@@ -1398,17 +1398,18 @@ class Readable:
return r
+try:
+ str(b'dummy', 'ascii')
+except TypeError:
+ # Typically we get here in Python 2.
+ as_str = str
+else:
def as_str(x):
"""
Convert ASCII bytes to string.
Only expected to be used in Python 3.
"""
return str(x, 'ascii')
-try:
- str(b'dummy', 'ascii')
-except TypeError:
- # Typically we get here in Python 2.
- as_str = str
class Reader:
