From 2adc80107a03b4e589b7ee46cdf5617b678fdc11 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 19 Oct 2015 17:35:02 +0000 Subject: [PATCH] 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. llvm-svn: 250710 --- lldb/examples/summaries/cocoa/metrics.py | 2 +- lldb/examples/synthetic/gnu_libstdcpp.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lldb/examples/summaries/cocoa/metrics.py b/lldb/examples/summaries/cocoa/metrics.py index f195498241db..6b82ff3b3015 100644 --- a/lldb/examples/summaries/cocoa/metrics.py +++ b/lldb/examples/summaries/cocoa/metrics.py @@ -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: diff --git a/lldb/examples/synthetic/gnu_libstdcpp.py b/lldb/examples/synthetic/gnu_libstdcpp.py index cc205960506a..8c11770899f7 100644 --- a/lldb/examples/synthetic/gnu_libstdcpp.py +++ b/lldb/examples/synthetic/gnu_libstdcpp.py @@ -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)