diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-08 02:27:06 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-08 02:27:06 +0200 |
| commit | b36892bb1d5d36e1f1fd867e3765430405e9fea6 (patch) | |
| tree | 62467bca280f81cde8dce1ae0b7193ce97e34ef0 /Doc/tutorial/stdlib2.rst | |
| parent | 6fb6ab057835952d150994c8bd8336614700e33e (diff) | |
| parent | 1a877306523645659e522fff951978fdc9cc1896 (diff) | |
| download | cpython-b36892bb1d5d36e1f1fd867e3765430405e9fea6.tar.gz | |
(merge 3.2) Issue #12423: Fix os.abort() documentation
The Python signal handler for SIGABRT is not called on os.abort() (only if the
signal is raised manually or sent by another process). Patch by Kamil Kisiel.
Diffstat (limited to 'Doc/tutorial/stdlib2.rst')
| -rw-r--r-- | Doc/tutorial/stdlib2.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index fe7f027b53..85c88dc23f 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst @@ -141,7 +141,9 @@ standard size and in little-endian byte order:: import struct - data = open('myfile.zip', 'rb').read() + with open('myfile.zip', 'rb') as f: + data = f.read() + start = 0 for i in range(3): # show the first 3 file headers start += 14 @@ -271,7 +273,7 @@ applications include caching objects that are expensive to create:: Traceback (most recent call last): File "<stdin>", line 1, in <module> d['primary'] # entry was automatically removed - File "C:/python31/lib/weakref.py", line 46, in __getitem__ + File "C:/python33/lib/weakref.py", line 46, in __getitem__ o = self.data[key]() KeyError: 'primary' |
