summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-10-22 16:16:13 (GMT)
committerGeorg Brandl <georg@python.org>2007-10-22 16:16:13 (GMT)
commit6464d471950c6ee109f82597ff70d755c127074f (patch)
tree6cae509d41f93e28b91405c76e97fea9fb7b4b32
parentb8990aac3a74309d9569fa543f83d754b8aa83d6 (diff)
downloadcpython-6464d471950c6ee109f82597ff70d755c127074f.zip
cpython-6464d471950c6ee109f82597ff70d755c127074f.tar.gz
cpython-6464d471950c6ee109f82597ff70d755c127074f.tar.bz2
In followup to #1310: Remove more exception indexing.
-rw-r--r--Lib/asyncore.py4
-rw-r--r--Lib/idlelib/run.py9
-rwxr-xr-xTools/i18n/pygettext.py3
3 files changed, 9 insertions, 7 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index ceaeeab..3829c61 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -120,7 +120,7 @@ def poll(timeout=0.0, map=None):
try:
r, w, e = select.select(r, w, e, timeout)
except select.error as err:
- if err[0] != EINTR:
+ if err.args[0] != EINTR:
raise
else:
return
@@ -166,7 +166,7 @@ def poll2(timeout=0.0, map=None):
try:
r = pollster.poll(timeout)
except select.error as err:
- if err[0] != EINTR:
+ if err.args[0] != EINTR:
raise
r = []
for fd, flags in r:
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index d98eea5..4ba5198 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -115,8 +115,8 @@ def manage_socket(address):
server = MyRPCServer(address, MyHandler)
break
except socket.error as err:
- print("IDLE Subprocess: socket error: "\
- + err[1] + ", retrying....", file=sys.__stderr__)
+ print("IDLE Subprocess: socket error: " + err.args[1] +
+ ", retrying....", file=sys.__stderr__)
else:
print("IDLE Subprocess: Connection to "\
"IDLE GUI failed, exiting.", file=sys.__stderr__)
@@ -131,14 +131,15 @@ def show_socket_error(err, address):
import tkMessageBox
root = Tkinter.Tk()
root.withdraw()
- if err[0] == 61: # connection refused
+ if err.args[0] == 61: # connection refused
msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\
"to your personal firewall configuration. It is safe to "\
"allow this internal connection because no data is visible on "\
"external ports." % address
tkMessageBox.showerror("IDLE Subprocess Error", msg, parent=root)
else:
- tkMessageBox.showerror("IDLE Subprocess Error", "Socket Error: %s" % err[1])
+ tkMessageBox.showerror("IDLE Subprocess Error",
+ "Socket Error: %s" % err.args[1])
root.destroy()
def print_exception():
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py
index cc25239..839846e 100755
--- a/Tools/i18n/pygettext.py
+++ b/Tools/i18n/pygettext.py
@@ -637,7 +637,8 @@ def main():
tokenize.tokenize(fp.readline, eater)
except tokenize.TokenError as e:
print('%s: %s, line %d, column %d' % (
- e[0], filename, e[1][0], e[1][1]), file=sys.stderr)
+ e.args[0], filename, e.args[1][0], e.args[1][1]),
+ file=sys.stderr)
finally:
if closep:
fp.close()