mirror of https://github.com/python/cpython
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone who knows how this module works test it? It can at least start on the cmd line.
This commit is contained in:
parent
d3c52de557
commit
e588c2ba97
|
@ -548,8 +548,10 @@ if __name__ == '__main__':
|
||||||
self.prompt = "% "
|
self.prompt = "% "
|
||||||
if profile is not None:
|
if profile is not None:
|
||||||
self.stats = Stats(profile)
|
self.stats = Stats(profile)
|
||||||
|
self.stream = self.stats.stream
|
||||||
else:
|
else:
|
||||||
self.stats = None
|
self.stats = None
|
||||||
|
self.stream = sys.stdout
|
||||||
|
|
||||||
def generic(self, fn, line):
|
def generic(self, fn, line):
|
||||||
args = line.split()
|
args = line.split()
|
||||||
|
@ -667,14 +669,15 @@ if __name__ == '__main__':
|
||||||
return None
|
return None
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
print >> self.stream, "Welcome to the profile statistics browser."
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
initprofile = sys.argv[1]
|
initprofile = sys.argv[1]
|
||||||
else:
|
else:
|
||||||
initprofile = None
|
initprofile = None
|
||||||
try:
|
try:
|
||||||
ProfileBrowser(initprofile).cmdloop()
|
browser = ProfileBrowser(initprofile)
|
||||||
print >> self.stream, "Goodbye."
|
print >> browser.stream, "Welcome to the profile statistics browser."
|
||||||
|
browser.cmdloop()
|
||||||
|
print >> browser.stream, "Goodbye."
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue