changeset 7646:e62a456b8dc5

error: move SignatureError
author Matt Mackall <mpm@selenic.com>
date Mon, 12 Jan 2009 13:51:43 -0600
parents 020a896a5292
children f7256cd9beff
files mercurial/dispatch.py mercurial/error.py mercurial/util.py
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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