#1322 Reduce duplicate "fixEncoding" code
Merged by mikem. Opened by tkopecek.
tkopecek/koji issue1318  into  master

Download 1322.patch

:thumbsup:

-        if isinstance(value, six.text_type):
+        if isinstance(value, unicode):
-        elif isinstance(value, six.binary_type):
+        elif isinstance(value, str):

I had thought about doing this, but it bothered me a little to have the name unicode referenced when it does not exist in py3 (even though this bit is underneath an if six.PY2:. Also flake8 complains:

[mike@localhost koji]$ git show |flake8 --diff
koji/__init__.py:3119:30: F821 undefined name 'unicode'
-    This is simply fixEncoding2 recursively applied to an object
+    This is simply fixEncoding recursively applied to an object

Good catch, but it should actually be fix_encoding.

I had thought about doing this, but it bothered me a little to have the name unicode referenced when it does not exist in py3 (even though this bit is underneath an if six.PY2:. Also flake8 complains:
[mike@localhost koji]$ git show |flake8 --diff
koji/init.py:3119:30: F821 undefined name 'unicode'

Problem is, that behaviour is different - six.text_type is basestring under py2, so we will never get to second branch.

(fixing docstring)

1 new commit added

  • fix docstring

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

Commit 2d0e63e3 fixes this pull-request

Pull-Request has been merged by mikem

Metadata