[openrtm-commit:03104] r922 - in trunk/OpenRTM-aist-Python/OpenRTM_aist: . utils/rtcprof

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 1月 23日 (火) 11:19:21 JST


Author: miyamoto
Date: 2018-01-23 11:19:21 +0900 (Tue, 23 Jan 2018)
New Revision: 922

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/utils/rtcprof/rtcprof.py
Log:
[compat, bugfix, ->RELENG_1_2] refs #3966

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py	2018-01-23 00:26:07 UTC (rev 921)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py	2018-01-23 02:19:21 UTC (rev 922)
@@ -282,6 +282,13 @@
     if not self.fileExist(file_path):
       raise ModuleManager.FileNotFound(file_name)
 
+    
+    with open(str(file_path)) as f:
+      if init_func is not None:
+        if f.read().find(init_func) == -1:
+          raise ModuleManager.FileNotFound(file_name)
+          
+
     if not pathChanged:
       splitted_name = os.path.split(file_path)
       sys.path.append(splitted_name[0])
@@ -474,6 +481,11 @@
     # for new
     comp_spec_name = classname+"_spec"
 
+
+    with open(str(fullname)) as f:
+      if f.read().find(comp_spec_name) == -1:
+        return None
+        
     try:
       imp_file = __import__(basename.split(".")[0])
     except:

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/utils/rtcprof/rtcprof.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/utils/rtcprof/rtcprof.py	2018-01-23 00:26:07 UTC (rev 921)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/utils/rtcprof/rtcprof.py	2018-01-23 02:19:21 UTC (rev 922)
@@ -61,6 +61,9 @@
   # for new
   comp_spec_name = classname+"_spec"
 
+  with open(str(fullname)) as f:
+    if f.read().find(comp_spec_name) == -1:
+      return
   try:
     imp_file = __import__(basename.split(".")[0])
   except:



More information about the openrtm-commit mailing list