提交 5b24c9e5 authored 作者: Olivier Breuleux's avatar Olivier Breuleux

compatibility fix

上级 38f533d5
......@@ -149,7 +149,6 @@ class PerformLinker(Linker):
from collections import defaultdict
import time
class Stats:
......@@ -180,12 +179,11 @@ class Profiler:
listed in ignore will not be timed.
"""
self.ignore = ignore
self.stats = defaultdict(Stats)
self.started = {}
self.stats = {}
self.by_class = by_class
def profile_env(self, f, env):
stats = self.stats['TOTAL']
stats = self.stats.setdefault('TOTAL', Stats())
n, t = stats.inc_ncalls, stats.inc_time
failed = False
......@@ -208,7 +206,7 @@ class Profiler:
entry = op.__class__
else:
entry = op
stats = self.stats[entry]
stats = self.stats.setdefault(entry, Stats())
n, t = stats.inc_ncalls, stats.inc_time
failed = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论