1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 13:31:48 +01:00

- _load_plugins: follow-up fix for commit 58d716a6f7

Only add functions to the Osc class which are defined in the _current_
module.
This commit is contained in:
Marcus Huewe 2013-07-23 12:10:31 +02:00
parent 12ffb4e3c4
commit 67a0671c8a

View File

@ -7984,9 +7984,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
mod.__dict__.update(globals()) mod.__dict__.update(globals())
for name in dir(mod): for name in dir(mod):
func = getattr(mod, name) func = getattr(mod, name)
# add all functions to the class (filtering only # add all functions (which are defined in the imported module)
# methods which start with "do_" breaks the old behavior) # to the class (filtering only methods which start with "do_"
if inspect.isfunction(func): # breaks the old behavior)
if inspect.isfunction(func) and inspect.getmodule(func) == mod:
setattr(self.__class__, name, func) setattr(self.__class__, name, func)
except SyntaxError as e: except SyntaxError as e:
if (os.environ.get('OSC_PLUGIN_FAIL_IGNORE')): if (os.environ.get('OSC_PLUGIN_FAIL_IGNORE')):