diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-10-30 19:56:43 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-10-30 19:56:43 (GMT) |
commit | 1625d88709abb45d392d1f48b1803ab5dde3bd77 (patch) | |
tree | a7a1fb02a5660a395623d49da10037d070bc1c79 /Doc/includes | |
parent | 5c89c19eae988245a826dc1f750c55ebb5f329bc (diff) | |
download | cpython-1625d88709abb45d392d1f48b1803ab5dde3bd77.zip cpython-1625d88709abb45d392d1f48b1803ab5dde3bd77.tar.gz cpython-1625d88709abb45d392d1f48b1803ab5dde3bd77.tar.bz2 |
Issue #16341: convert examples to use except ... as ... syntax.
Diffstat (limited to 'Doc/includes')
-rw-r--r-- | Doc/includes/email-unpack.py | 2 | ||||
-rw-r--r-- | Doc/includes/sqlite3/complete_statement.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Doc/includes/email-unpack.py b/Doc/includes/email-unpack.py index 8f99ded..a8f712d 100644 --- a/Doc/includes/email-unpack.py +++ b/Doc/includes/email-unpack.py @@ -35,7 +35,7 @@ Usage: %prog [options] msgfile try: os.mkdir(opts.directory) - except OSError, e: + except OSError as e: # Ignore directory exists error if e.errno != errno.EEXIST: raise diff --git a/Doc/includes/sqlite3/complete_statement.py b/Doc/includes/sqlite3/complete_statement.py index 22525e3..76ea7f6 100644 --- a/Doc/includes/sqlite3/complete_statement.py +++ b/Doc/includes/sqlite3/complete_statement.py @@ -23,7 +23,7 @@ while True: if buffer.lstrip().upper().startswith("SELECT"): print cur.fetchall() - except sqlite3.Error, e: + except sqlite3.Error as e: print "An error occurred:", e.args[0] buffer = "" |