Sfoglia il codice sorgente

Complain when an attribute is not found

Hamilton Turner 11 anni fa
parent
commit
bfefdc446b
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      toolset/benchmark/framework_test.py

+ 7 - 1
toolset/benchmark/framework_test.py

@@ -1233,7 +1233,13 @@ class FrameworkTest:
   def __getattr__(self, name):
     """For backwards compatibility, we used to pass benchmarker 
     as the argument to the setup.py files"""
-    return getattr(self.benchmarker, name)
+    try:
+      x = getattr(self.benchmarker, name)
+    except AttributeError:
+      print "AttributeError: %s not a member of FrameworkTest or Benchmarker" % name
+      print "This is probably a bug"
+      raise
+    return x
 
   ##############################################################
   # Begin __calculate_average_stats