error: move SignatureError
authorMatt Mackall <mpm@selenic.com>
Mon, 12 Jan 2009 13:51:43 -0600
changeset 7646 e62a456b8dc5
parent 7645 020a896a5292
child 7647 f7256cd9beff
error: move SignatureError
mercurial/dispatch.py
mercurial/error.py
mercurial/util.py
--- a/mercurial/dispatch.py	Mon Jan 12 13:35:35 2009 -0600
+++ b/mercurial/dispatch.py	Mon Jan 12 13:51:43 2009 -0600
@@ -371,7 +371,7 @@
     def checkargs():
         try:
             return cmdfunc()
-        except util.SignatureError:
+        except error.SignatureError:
             raise error.ParseError(cmd, _("invalid arguments"))
 
     if options['profile']:
--- a/mercurial/error.py	Mon Jan 12 13:35:35 2009 -0600
+++ b/mercurial/error.py	Mon Jan 12 13:51:43 2009 -0600
@@ -59,3 +59,6 @@
 # derived from KeyboardInterrupt to simplify some breakout code
 class SignalInterrupt(KeyboardInterrupt):
     """Exception raised on SIGTERM and SIGHUP."""
+
+class SignatureError(Exception):
+    pass
--- a/mercurial/util.py	Mon Jan 12 13:35:35 2009 -0600
+++ b/mercurial/util.py	Mon Jan 12 13:51:43 2009 -0600
@@ -13,7 +13,7 @@
 """
 
 from i18n import _
-import cStringIO, errno, getpass, re, shutil, sys, tempfile, traceback
+import cStringIO, errno, getpass, re, shutil, sys, tempfile, traceback, error
 import os, stat, threading, time, calendar, ConfigParser, locale, glob, osutil
 import imp
 
@@ -707,9 +707,6 @@
         if cwd is not None and oldcwd != cwd:
             os.chdir(oldcwd)
 
-class SignatureError(Exception):
-    pass
-
 def checksignature(func):
     '''wrap a function with code to check for calling errors'''
     def check(*args, **kwargs):
@@ -717,7 +714,7 @@
             return func(*args, **kwargs)
         except TypeError:
             if len(traceback.extract_tb(sys.exc_info()[2])) == 1:
-                raise SignatureError
+                raise error.SignatureError
             raise
 
     return check