]> granicus.if.org Git - python/commitdiff
Fix two bugs detected by PyChecker: there's no need for redundant
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2001 21:22:15 +0000 (21:22 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2001 21:22:15 +0000 (21:22 +0000)
"import MacOS", and there *is* a need for "import operator".

Lib/profile.py

index 5df1025ed0fb4f93009be912c2c94eb9948cc8c3..b92bd91882539ff6d0265ae6218e9cc05fad4d5d 100755 (executable)
@@ -145,7 +145,6 @@ class Profile:
 
         if not timer:
             if os.name == 'mac':
-                import MacOS
                 self.timer = MacOS.GetTicks
                 self.dispatcher = self.trace_dispatch_mac
                 self.get_time = _get_time_mac
@@ -177,6 +176,7 @@ class Profile:
                 # list (for performance).  Note that we can't assume
                 # the timer() result contains two values in all
                 # cases.
+                import operator
                 def get_time_timer(timer=timer,
                                    reduce=reduce, reducer=operator.add):
                     return reduce(reducer, timer(), 0)