fix StringType and itervalues in plugin and cli

This commit is contained in:
Yuming Zhu 2017-06-21 21:23:33 +08:00 committed by Mike McLean
parent 9d812166ac
commit e64c57e866
2 changed files with 3 additions and 2 deletions

View file

@ -51,7 +51,7 @@ def register_plugin(plugin):
Handlers are functions marked with one of the decorators defined in koji.plugin
"""
for v in vars(plugin).itervalues():
for v in six.itervalues(vars(plugin)):
if isinstance(v, (types.ClassType, types.TypeType)):
#skip classes
continue

View file

@ -24,6 +24,7 @@ import koji
import logging
import sys
import traceback
import six
# the available callback hooks and a list
# of functions to be called for each event
@ -91,7 +92,7 @@ class PluginTracker(object):
return self.plugins.get(name)
def pathlist(self, path):
if isinstance(path, basestring):
if isinstance(path, six.string_types):
return [path]
else:
return path