Opened 3 years ago

Last modified 2 years ago

#5714 task new

Use Exception.args instead of iterating over it

Reported by: vperic Owned by: vperic
Priority: normal Milestone: Python-3.x
Component: core Keywords: py3k
Cc: Branch: branches/except-args-5714
(diff, github, buildbot, log)
Author: vperic Launchpad Bug:

Description

In Python 3, it is no longer possible to iterate over an exception, because the getitem method is no longer supported. The solution is to use args to access what we need.

Change History (3)

comment:1 Changed 3 years ago by vperic

  • Author set to vperic
  • Branch set to branches/except-args-5714

(In [34596]) Create branch except-args-5714

comment:2 Changed 3 years ago by vperic

  • Keywords review added
  • Owner vperic deleted

This should be trivial enough, there were just 4 cases. Build results.

comment:3 Changed 2 years ago by exarkun

  • Keywords review removed
  • Owner set to vperic

The errno attribute of these exception types is a better replacement than args[0].

Note: See TracTickets for help on using tickets.