mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix two bugs detected by PyChecker: there's no need for redundant
"import MacOS", and there *is* a need for "import operator".
This commit is contained in:
parent
6386a4c846
commit
e4deb959cc
1 changed files with 1 additions and 1 deletions
|
@ -145,7 +145,6 @@ class Profile:
|
||||||
|
|
||||||
if not timer:
|
if not timer:
|
||||||
if os.name == 'mac':
|
if os.name == 'mac':
|
||||||
import MacOS
|
|
||||||
self.timer = MacOS.GetTicks
|
self.timer = MacOS.GetTicks
|
||||||
self.dispatcher = self.trace_dispatch_mac
|
self.dispatcher = self.trace_dispatch_mac
|
||||||
self.get_time = _get_time_mac
|
self.get_time = _get_time_mac
|
||||||
|
@ -177,6 +176,7 @@ class Profile:
|
||||||
# list (for performance). Note that we can't assume
|
# list (for performance). Note that we can't assume
|
||||||
# the timer() result contains two values in all
|
# the timer() result contains two values in all
|
||||||
# cases.
|
# cases.
|
||||||
|
import operator
|
||||||
def get_time_timer(timer=timer,
|
def get_time_timer(timer=timer,
|
||||||
reduce=reduce, reducer=operator.add):
|
reduce=reduce, reducer=operator.add):
|
||||||
return reduce(reducer, timer(), 0)
|
return reduce(reducer, timer(), 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue