diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-16 20:30:51 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-16 20:30:51 -0400 |
commit | 7fe7955f27f6cd7884ed802d384663e6b79f1a0d (patch) | |
tree | 189b07deeecd4410bab7ece1a79584639a73ff0a /tools.py | |
parent | 2e258c088f582e820ca274346d224ea460b52661 (diff) | |
parent | 1476f921813e60cf3749a5d03b9ed5cbf1951db6 (diff) | |
download | chroma-7fe7955f27f6cd7884ed802d384663e6b79f1a0d.tar.gz chroma-7fe7955f27f6cd7884ed802d384663e6b79f1a0d.tar.bz2 chroma-7fe7955f27f6cd7884ed802d384663e6b79f1a0d.zip |
merge documentation changes
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -17,16 +17,18 @@ def debugger_hook(type, value, tb): pdb.pm() def enable_debug_on_crash(): - '''Start the PDB console when an uncaught exception propagates to the top.''' + "Start the PDB console when an uncaught exception propagates to the top." sys.excepthook = debugger_hook -# Allow profile decorator to exist, but do nothing if not running under kernprof +# allow profile decorator to exist, but do nothing if not running under +# kernprof try: profile_if_possible = profile except NameError: profile_if_possible = lambda x: x def timeit(func): + "A decorator to print the time elapsed in a function call." def f(*args, **kwargs): t0 = time.time() retval = func(*args, **kwargs) |