Kaydet (Commit) fb2c459a authored tarafından Georg Brandl's avatar Georg Brandl

Fix merging glitches.

üst 9c5efadf
...@@ -150,7 +150,7 @@ class Stats: ...@@ -150,7 +150,7 @@ class Stats:
if not arg_list: return self if not arg_list: return self
if len(arg_list) > 1: self.add(*arg_list[1:]) if len(arg_list) > 1: self.add(*arg_list[1:])
other = arg_list[0] other = arg_list[0]
if type(self) != type(other): if type(self) != type(other) or self.__class__ != other.__class__:
other = Stats(other) other = Stats(other)
self.files += other.files self.files += other.files
self.total_calls += other.total_calls self.total_calls += other.total_calls
...@@ -218,7 +218,7 @@ class Stats: ...@@ -218,7 +218,7 @@ class Stats:
if not field: if not field:
self.fcn_list = 0 self.fcn_list = 0
return self return self
if len(field) == 1 and isinstance(field[0], int): if len(field) == 1 and isinstance(field[0], (int, long)):
# Be compatible with old profiler # Be compatible with old profiler
field = [ {-1: "stdname", field = [ {-1: "stdname",
0: "calls", 0: "calls",
...@@ -300,7 +300,7 @@ class Stats: ...@@ -300,7 +300,7 @@ class Stats:
def eval_print_amount(self, sel, list, msg): def eval_print_amount(self, sel, list, msg):
new_list = list new_list = list
if isinstance(sel, str): if isinstance(sel, basestring):
try: try:
rex = re.compile(sel) rex = re.compile(sel)
except re.error: except re.error:
...@@ -315,7 +315,7 @@ class Stats: ...@@ -315,7 +315,7 @@ class Stats:
if isinstance(sel, float) and 0.0 <= sel < 1.0: if isinstance(sel, float) and 0.0 <= sel < 1.0:
count = int(count * sel + .5) count = int(count * sel + .5)
new_list = list[:count] new_list = list[:count]
elif isinstance(sel, int) and 0 <= sel < count: elif isinstance(sel, (int, long)) and 0 <= sel < count:
count = sel count = sel
new_list = list[:count] new_list = list[:count]
if len(list) != len(new_list): if len(list) != len(new_list):
...@@ -330,7 +330,7 @@ class Stats: ...@@ -330,7 +330,7 @@ class Stats:
stat_list = self.fcn_list[:] stat_list = self.fcn_list[:]
msg = " Ordered by: " + self.sort_type + '\n' msg = " Ordered by: " + self.sort_type + '\n'
else: else:
stat_list = list(self.stats.keys()) stat_list = self.stats.keys()
msg = " Random listing order was used\n" msg = " Random listing order was used\n"
for selection in sel_list: for selection in sel_list:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment