changeset 7421:4c4324476be6

Catch both IOError and OSError, fix regression introduced by 8046f0a070a6
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 26 Nov 2008 18:23:35 +0100
parents b4ac1e2cd38c
children 279a883aa1a0 f21e3d0e335b
files hgext/mq.py tests/test-mq-qimport tests/test-mq-qimport.out
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Tue Nov 25 18:45:08 2008 -0800
+++ b/hgext/mq.py	Wed Nov 26 18:23:35 2008 +0100
@@ -1583,7 +1583,7 @@
                         text = sys.stdin.read()
                     else:
                         text = url.open(self.ui, filename).read()
-                except IOError:
+                except (OSError, IOError):
                     raise util.Abort(_("unable to read %s") % filename)
                 if not patchname:
                     patchname = normname(os.path.basename(filename))
--- a/tests/test-mq-qimport	Tue Nov 25 18:45:08 2008 -0800
+++ b/tests/test-mq-qimport	Wed Nov 26 18:23:35 2008 +0100
@@ -25,7 +25,7 @@
 cd repo
 
 echo % qimport non-existing-file
-hg qimport non-existing-file 2>&1 | sed -e 's/\(No such file or directory:\) .*/\1/'
+hg qimport non-existing-file
 
 echo % import URL
 echo foo >> foo
--- a/tests/test-mq-qimport.out	Tue Nov 25 18:45:08 2008 -0800
+++ b/tests/test-mq-qimport.out	Wed Nov 26 18:23:35 2008 +0100
@@ -1,5 +1,5 @@
 % qimport non-existing-file
-abort: No such file or directory:
+abort: unable to read non-existing-file
 % import URL
 adding url.diff to series file
 url.diff