mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #16341: convert examples to use except ... as ... syntax.
This commit is contained in:
parent
5c89c19eae
commit
1625d88709
10 changed files with 21 additions and 22 deletions
|
@ -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
|
||||
|
|
|
@ -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 = ""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue