cleanup: replace naked excepts with more specific ones stable
authorBrodie Rao <brodie@sf.io>
Sat, 12 May 2012 16:02:45 +0200
branchstable
changeset 1072 bbf056e756cc
parent 1071 f0ce3dcd5c87
child 1073 bc8e57c1ae32
cleanup: replace naked excepts with more specific ones [ original upstream message ]
tests/hghave
tests/run-tests.py
--- a/tests/hghave	Sat May 12 16:00:53 2012 +0200
+++ b/tests/hghave	Sat May 12 16:02:45 2012 +0200
@@ -60,7 +60,7 @@
         os.close(fd)
         os.remove(path)
         return True
-    except:
+    except (IOError, OSError):
         return False
 
 def has_executablebit():
@@ -93,7 +93,7 @@
         try:
             s2 = os.stat(p2)
             return s2 == s1
-        except:
+        except OSError:
             return False
     finally:
         os.remove(path)
--- a/tests/run-tests.py	Sat May 12 16:00:53 2012 +0200
+++ b/tests/run-tests.py	Sat May 12 16:02:45 2012 +0200
@@ -860,7 +860,7 @@
         tf = open(testpath)
         firstline = tf.readline().rstrip()
         tf.close()
-    except:
+    except IOError:
         firstline = ''
     lctest = test.lower()