diff options
author | Guido van Rossum <guido@python.org> | 1996-05-28 23:00:42 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-05-28 23:00:42 (GMT) |
commit | 6cb84f3cde6b9848b8e9b2a371b0ba1acaff1d70 (patch) | |
tree | 5a3660c15bd7f7b738fa102ac1cdc512e42bf005 | |
parent | 8460b94b50db229ac28b3ba300c4b97bc4e3700c (diff) | |
download | cpython-6cb84f3cde6b9848b8e9b2a371b0ba1acaff1d70.zip cpython-6cb84f3cde6b9848b8e9b2a371b0ba1acaff1d70.tar.gz cpython-6cb84f3cde6b9848b8e9b2a371b0ba1acaff1d70.tar.bz2 |
change return values of simple run* functions
-rwxr-xr-x | Lib/profile.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/profile.py b/Lib/profile.py index 715aa4b..7f4abed 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -396,8 +396,7 @@ class Profile: def run(self, cmd): import __main__ dict = __main__.__dict__ - self.runctx(cmd, dict, dict) - return self + return self.runctx(cmd, dict, dict) def runctx(self, cmd, globals, locals): self.set_cmd(cmd) @@ -406,16 +405,16 @@ class Profile: exec cmd in globals, locals finally: sys.setprofile(None) + return self # This method is more useful to profile a single function call. def runcall(self, func, *args): self.set_cmd(`func`) sys.setprofile(self.dispatcher) try: - apply(func, args) + return apply(func, args) finally: sys.setprofile(None) - return self #****************************************************************** |