Author: zturner Date: Mon Oct 19 12:35:02 2015 New Revision: 250710 URL: http://llvm.org/viewvc/llvm-project?rev=250710&view=rev Log: Py3'ify some of the examples that get run at startup.
Even though these are under examples/, they actually get loaded when LLDB starts up during initialization of ScriptInterpreterPython. There's obviously some kind of layering issue here (and comments in the code even point to that as well), but for now just make them py3 compatible. Modified: lldb/trunk/examples/summaries/cocoa/metrics.py lldb/trunk/examples/synthetic/gnu_libstdcpp.py Modified: lldb/trunk/examples/summaries/cocoa/metrics.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/summaries/cocoa/metrics.py?rev=250710&r1=250709&r2=250710&view=diff ============================================================================== --- lldb/trunk/examples/summaries/cocoa/metrics.py (original) +++ lldb/trunk/examples/summaries/cocoa/metrics.py Mon Oct 19 12:35:02 2015 @@ -25,7 +25,7 @@ class TimeMetrics: def __exit__(self, a,b,c): self.exit_time = time.clock() - print "It took " + str(self.exit_time - self.enter_time) + " time units to run through " + self.function + self.label + print("It took " + str(self.exit_time - self.enter_time) + " time units to run through " + self.function + self.label) return False class Counter: Modified: lldb/trunk/examples/synthetic/gnu_libstdcpp.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/synthetic/gnu_libstdcpp.py?rev=250710&r1=250709&r2=250710&view=diff ============================================================================== --- lldb/trunk/examples/synthetic/gnu_libstdcpp.py (original) +++ lldb/trunk/examples/synthetic/gnu_libstdcpp.py Mon Oct 19 12:35:02 2015 @@ -137,11 +137,11 @@ class StdVectorSynthProvider: self.count = None def num_children(self): - if self.count == None: - self.count = self.num_children_impl() - return self.count + if self.count == None: + self.count = self.num_children_impl() + return self.count - def num_children_impl(self): + def num_children_impl(self): try: start_val = self.start.GetValueAsUnsigned(0) finish_val = self.finish.GetValueAsUnsigned(0) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits