summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-11-02 20:07:26 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-11-02 20:07:26 (GMT)
commit47395617bc2a6d2188039bf30e637bc203f93aba (patch)
tree0eb85bbca0f7dd25c619186c565f92fd63dfb886 /Doc/library
parentc38c816ea16b37cdc07970474c2a477f216c27ce (diff)
downloadcpython-47395617bc2a6d2188039bf30e637bc203f93aba.zip
cpython-47395617bc2a6d2188039bf30e637bc203f93aba.tar.gz
cpython-47395617bc2a6d2188039bf30e637bc203f93aba.tar.bz2
Issue #16261: fix bare excepts in Doc/
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/timeit.rst2
-rw-r--r--Doc/library/traceback.rst2
2 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index a487917..0cc1586 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -151,7 +151,7 @@ The module defines three convenience functions and a public class:
t = Timer(...) # outside the try/except
try:
t.timeit(...) # or t.repeat(...)
- except:
+ except Exception:
t.print_exc()
The advantage over the standard traceback is that source lines in the
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 32e5733..0533bea 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -146,7 +146,7 @@ module. ::
source = input(">>> ")
try:
exec(source, envdir)
- except:
+ except Exception:
print("Exception in user code:")
print("-"*60)
traceback.print_exc(file=sys.stdout)