mercurial/ui.py
changeset 30927 8fa3ab6221b9
parent 30926 120682fce099
child 30932 f61c5680a862
--- a/mercurial/ui.py	Sun Feb 12 21:40:46 2017 -0800
+++ b/mercurial/ui.py	Sun Feb 12 21:44:55 2017 -0800
@@ -453,17 +453,11 @@
         >>> u.configint(s, 'invalid')
         Traceback (most recent call last):
             ...
-        ConfigError: foo.invalid is not an integer ('somevalue')
+        ConfigError: foo.invalid is not a valid integer ('somevalue')
         """
 
-        v = self.config(section, name, None, untrusted)
-        if v is None:
-            return default
-        try:
-            return int(v)
-        except ValueError:
-            raise error.ConfigError(_("%s.%s is not an integer ('%s')")
-                                    % (section, name, v))
+        return self.configwith(int, section, name, default, 'integer',
+                               untrusted)
 
     def configbytes(self, section, name, default=0, untrusted=False):
         """parse a configuration element as a quantity in bytes