~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-09 18:02:00 UTC
  • mfrom: (1963.2.7 bzr.dev.no_has_key)
  • Revision ID: pqm@pqm.ubuntu.com-20060909180200-96e41112dff213f3
(robey) remove hasattr and == None in favor of getattr() and is None

Show diffs side-by-side

added added

removed removed

Lines of Context:
547
547
        """
548
548
        # paramiko seems to generate detailless errors.
549
549
        self._translate_error(e, path, raise_generic=False)
550
 
        if hasattr(e, 'args'):
 
550
        if getattr(e, 'args', None) is not None:
551
551
            if (e.args == ('No such file or directory',) or
552
552
                e.args == ('No such file',)):
553
553
                raise NoSuchFile(path, str(e) + more_info)
557
557
            if (e.args == ('Failure',)):
558
558
                raise failure_exc(path, str(e) + more_info)
559
559
            mutter('Raising exception with args %s', e.args)
560
 
        if hasattr(e, 'errno'):
 
560
        if getattr(e, 'errno', None) is not None:
561
561
            mutter('Raising exception with errno %s', e.errno)
562
562
        raise e
563
563