diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-01-17 13:31:33 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-01-17 13:31:33 +0100 |
| commit | ef77bd9cc237bd3ddae8e22fd325b412ad46ab00 (patch) | |
| tree | 59e0a698c466885d32518e47901dce5ebb697cdf /apt | |
| parent | 773c5de21c809c7fe07eefafa252efa0b6758744 (diff) | |
| download | python-apt-ef77bd9cc237bd3ddae8e22fd325b412ad46ab00.tar.gz | |
apt/progress/base.py: Use attributes of IOError and OSError object.
Do not treat them as tuples, but use the attributes. This is way more
'modern'.
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/progress/base.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py index adb39e93..4df26f26 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -206,10 +206,10 @@ class InstallProgress(object): """Update the interface.""" try: line = self.statusfd.readline() - except IOError, (errno_, errstr): + except IOError, err: # resource temporarly unavailable is ignored - if errno_ != errno.EAGAIN and errno_ != errno.EWOULDBLOCK: - print errstr + if err.errno != errno.EAGAIN and err.errno != errno.EWOULDBLOCK: + print err.strerror return pkgname = status = status_str = percent = base = "" @@ -254,7 +254,7 @@ class InstallProgress(object): try: select.select([self.statusfd], [], [], self.select_timeout) except select.error, err: - if err[0] != errno.EINTR: + if err.errno != errno.EINTR: raise self.update_interface() @@ -263,9 +263,9 @@ class InstallProgress(object): if pid == self.child_pid: break except OSError, err: - if err[0] == errno.ECHILD: + if err.errno == errno.ECHILD: break - if err[0] != errno.EINTR: + if err.errno != errno.EINTR: raise return res |
