unpacker: check the right exception type for 2.4
authorMatt Mackall <mpm@selenic.com>
Tue, 13 Jan 2015 16:15:02 -0800
changeset 23832 62f41f251e52
parent 23831 0ab23a48b9a7
child 23833 9b1d3bac61a7
unpacker: check the right exception type for 2.4
mercurial/util.py
--- a/mercurial/util.py	Sat Jan 10 18:00:57 2015 +0800
+++ b/mercurial/util.py	Tue Jan 13 16:15:02 2015 -0800
@@ -234,7 +234,7 @@
     try:
         # 2.5+
         return struct.Struct(fmt).unpack
-    except NameError:
+    except AttributeError:
         # 2.4
         return lambda buf: struct.unpack(fmt)