Run 2to3.

This commit is contained in:
Ryan Stein 2017-10-29 13:40:30 -04:00
parent a5a8d9dd57
commit 6fa280b9fd
157 changed files with 976 additions and 976 deletions

View file

@ -422,13 +422,13 @@ class CmdSetHandler(object):
it's a 'quirk' that has to be documented.
"""
if not (isinstance(cmdset, basestring) or utils.inherits_from(cmdset, CmdSet)):
if not (isinstance(cmdset, str) or utils.inherits_from(cmdset, CmdSet)):
string = _("Only CmdSets can be added to the cmdsethandler!")
raise Exception(string)
if callable(cmdset):
cmdset = cmdset(self.obj)
elif isinstance(cmdset, basestring):
elif isinstance(cmdset, str):
# this is (maybe) a python path. Try to import from cache.
cmdset = self._import_cmdset(cmdset)
if cmdset and cmdset.key != '_CMDSET_ERROR':
@ -586,11 +586,11 @@ class CmdSetHandler(object):
"""
if callable(cmdset) and hasattr(cmdset, 'path'):
# try it as a callable
print "Try callable", cmdset
print("Try callable", cmdset)
if must_be_default:
return self.cmdset_stack and (self.cmdset_stack[0].path == cmdset.path)
else:
print [cset.path for cset in self.cmdset_stack], cmdset.path
print([cset.path for cset in self.cmdset_stack], cmdset.path)
return any([cset for cset in self.cmdset_stack
if cset.path == cmdset.path])
else: