summaryrefslogtreecommitdiffstats
path: root/Lib/pstats.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-11 07:27:56 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-11 07:27:56 (GMT)
commite588c2ba9716a81358438b4e7cd23724dcef2ba9 (patch)
tree26e3a1165a321d71391512b72928d71690be6d8c /Lib/pstats.py
parentd3c52de557546cf2381e27b7fc9b86676fec9a9d (diff)
downloadcpython-e588c2ba9716a81358438b4e7cd23724dcef2ba9.zip
cpython-e588c2ba9716a81358438b4e7cd23724dcef2ba9.tar.gz
cpython-e588c2ba9716a81358438b4e7cd23724dcef2ba9.tar.bz2
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.
Diffstat (limited to 'Lib/pstats.py')
-rw-r--r--Lib/pstats.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/pstats.py b/Lib/pstats.py
index c3a8828..4e94b0c 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -548,8 +548,10 @@ if __name__ == '__main__':
self.prompt = "% "
if profile is not None:
self.stats = Stats(profile)
+ self.stream = self.stats.stream
else:
self.stats = None
+ self.stream = sys.stdout
def generic(self, fn, line):
args = line.split()
@@ -667,14 +669,15 @@ if __name__ == '__main__':
return None
import sys
- print >> self.stream, "Welcome to the profile statistics browser."
if len(sys.argv) > 1:
initprofile = sys.argv[1]
else:
initprofile = None
try:
- ProfileBrowser(initprofile).cmdloop()
- print >> self.stream, "Goodbye."
+ browser = ProfileBrowser(initprofile)
+ print >> browser.stream, "Welcome to the profile statistics browser."
+ browser.cmdloop()
+ print >> browser.stream, "Goodbye."
except KeyboardInterrupt:
pass