Catch both IOError and OSError, fix regression introduced by 8046f0a070a6
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 26 Nov 2008 18:23:35 +0100
changeset 7421 4c4324476be6
parent 7420 b4ac1e2cd38c
child 7422 279a883aa1a0
child 7427 f21e3d0e335b
Catch both IOError and OSError, fix regression introduced by 8046f0a070a6
hgext/mq.py
tests/test-mq-qimport
tests/test-mq-qimport.out
--- 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