tonysun83 commented on a change in pull request #839: Fix tests to be
compatible for both python2 and python3
URL: https://github.com/apache/couchdb/pull/839#discussion_r140938273
##########
File path: src/mango/test/mango.py
##########
@@ -44,7 +44,7 @@ def url(self):
return "http://{}:{}/{}".format(self.host, self.port, self.dbname)
def path(self, parts):
- if isinstance(parts, (str, unicode)):
+ if isinstance(parts, ("".__class__, u"".__class__)):
Review comment:
only part worth of note. Another way to do this is :
```
try:
basestring # attempt to evaluate basestring
def isstr(s):
return isinstance(s, basestring)
except NameError:
def isstr(s):
return isinstance(s, str)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services