Repository navigation
Use six instead of twisted.python.compat - #290
Conversation
|
I'm guessing an empty newsfragment isn't needed here. If it is, let me know. |
| if not _PY3: | ||
| from StringIO import StringIO | ||
| if PY2: | ||
| registerAdapter(_from_file, StringIO, IBodyProducer) |
There was a problem hiding this comment.
io.StringIO is the wrong StringIO
| registerAdapter(_from_file, StringIO, IBodyProducer) | |
| registerAdapter(_from_file, six.StringIO, IBodyProducer) |
There was a problem hiding this comment.
it's best to
import io
import six
and then use io.StringIO or six.StringIO so it's obvious
There was a problem hiding this comment.
I think it is coming from six. (aren't these from imports great?)
There was a problem hiding this comment.
ah right, that's super confusing
There was a problem hiding this comment.
@altendky the first hit for six uses an idiomatic import:
treq/src/treq/test/local_httpbin/child.py
Line 13 in bea6878
There was a problem hiding this comment.
I'd recommend following modernize here and using idiomatic-style imports for both io and six https://modernize.readthedocs.io/en/latest/fixers.html#unicode_type
There was a problem hiding this comment.
Over following the existing local practice? (and that import is off in some other file that i didn't get to touching)
|
A newsfile along the lines of "Compatibility with Twisted 20.9.0" would be nice, except we don't know what version to put there. I will add that retroactively I guess. |
|
Thank you both for this! I will release once #284 is in. |
#288