# HG changeset patch # User Benoit Boissinot # Date 1227720215 -3600 # Node ID 4c4324476be6315b0e8622b62fed68720aacd855 # Parent b4ac1e2cd38c6ffb615390919cc3cc1c33652c69 Catch both IOError and OSError, fix regression introduced by 8046f0a070a6 diff -r b4ac1e2cd38c -r 4c4324476be6 hgext/mq.py --- 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)) diff -r b4ac1e2cd38c -r 4c4324476be6 tests/test-mq-qimport --- 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 diff -r b4ac1e2cd38c -r 4c4324476be6 tests/test-mq-qimport.out --- 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