Ignore:
Timestamp:
Mar 30, 2013, 11:27:29 PM (6 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Use `except ExceptionClass as exc` for future Python 3 compatibility.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/file.py

    r1191 r1194  
    236236                with ftputil.error.ftplib_error_to_ftp_io_error:
    237237                    self._session.voidresp()
    238             except ftputil.error.FTPIOError, exception:
     238            except ftputil.error.FTPIOError as exc:
    239239                # Ignore some errors, see tickets #51 and #17 at
    240240                # http://ftputil.sschwarzer.net/trac/ticket/51 and
    241241                # http://ftputil.sschwarzer.net/trac/ticket/17,
    242242                # respectively.
    243                 exception = str(exception)
    244                 error_code = exception[:3]
    245                 if exception.splitlines()[0] != "timed out" and \
     243                exc = str(exc)
     244                error_code = exc[:3]
     245                if exc.splitlines()[0] != "timed out" and \
    246246                  error_code not in ("150", "426", "450", "451"):
    247247                    raise
Note: See TracChangeset for help on using the changeset viewer.