summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/base/app_manager.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
index 695c401e..357d34d6 100644
--- a/ryu/base/app_manager.py
+++ b/ryu/base/app_manager.py
@@ -27,6 +27,7 @@ import inspect
import itertools
import logging
import sys
+import os
from ryu import cfg
from ryu import utils
@@ -338,8 +339,11 @@ class AppManager(object):
def load_app(self, name):
mod = utils.import_module(name)
- clses = inspect.getmembers(mod, lambda cls: (inspect.isclass(cls) and
- issubclass(cls, RyuApp)))
+ clses = inspect.getmembers(mod,
+ lambda cls: (inspect.isclass(cls) and
+ issubclass(cls, RyuApp) and
+ mod.__name__ ==
+ cls.__module__))
if clses:
return clses[0][1]
return None