From 67a0671c8ab60b41d135f32086f22aa5c1ccf920 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Tue, 23 Jul 2013 12:10:31 +0200 Subject: [PATCH] - _load_plugins: follow-up fix for commit 58d716a6f7ed1eeff7f2a15cf76c6552ec2f6ed0 Only add functions to the Osc class which are defined in the _current_ module. --- osc/commandline.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index c31d2e14..ff6425ee 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -7984,9 +7984,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. mod.__dict__.update(globals()) for name in dir(mod): func = getattr(mod, name) - # add all functions to the class (filtering only - # methods which start with "do_" breaks the old behavior) - if inspect.isfunction(func): + # add all functions (which are defined in the imported module) + # to the class (filtering only methods which start with "do_" + # breaks the old behavior) + if inspect.isfunction(func) and inspect.getmodule(func) == mod: setattr(self.__class__, name, func) except SyntaxError as e: if (os.environ.get('OSC_PLUGIN_FAIL_IGNORE')):