changeset 16687:e34106fa0dc3

cleanup: "raise SomeException()" -> "raise SomeException"
author Brodie Rao <brodie@sf.io>
date Sat, 12 May 2012 16:00:58 +0200
parents 67964cda8701
children cfb6682961b8
files contrib/debugcmdserver.py hgext/convert/common.py hgext/convert/git.py hgext/convert/hg.py hgext/convert/monotone.py hgext/convert/subversion.py hgext/largefiles/lfcommands.py hgext/mq.py mercurial/cmdutil.py mercurial/commandserver.py mercurial/dagutil.py mercurial/hgweb/common.py mercurial/keepalive.py mercurial/match.py mercurial/patch.py mercurial/simplemerge.py mercurial/win32.py mercurial/windows.py tests/test-commandserver.py
diffstat 19 files changed, 45 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/debugcmdserver.py	Sat May 12 16:00:57 2012 +0200
+++ b/contrib/debugcmdserver.py	Sat May 12 16:00:58 2012 +0200
@@ -24,7 +24,7 @@
 def read(size):
     data = sys.stdin.read(size)
     if not data:
-        raise EOFError()
+        raise EOFError
     sys.stdout.write(data)
     sys.stdout.flush()
     return data
--- a/hgext/convert/common.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/convert/common.py	Sat May 12 16:00:58 2012 +0200
@@ -76,7 +76,7 @@
 
     def getheads(self):
         """Return a list of this repository's heads"""
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def getfile(self, name, rev):
         """Return a pair (data, mode) where data is the file content
@@ -84,7 +84,7 @@
         identifier returned by a previous call to getchanges(). Raise
         IOError to indicate that name was deleted in rev.
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def getchanges(self, version):
         """Returns a tuple of (files, copies).
@@ -95,18 +95,18 @@
 
         copies is a dictionary of dest: source
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def getcommit(self, version):
         """Return the commit object for version"""
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def gettags(self):
         """Return the tags as a dictionary of name: revision
 
         Tag names must be UTF-8 strings.
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def recode(self, s, encoding=None):
         if not encoding:
@@ -133,7 +133,7 @@
 
         This function is only needed to support --filemap
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def converted(self, rev, sinkrev):
         '''Notify the source that a revision has been converted.'''
@@ -175,13 +175,13 @@
 
     def getheads(self):
         """Return a list of this repository's heads"""
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def revmapfile(self):
         """Path to a file that will contain lines
         source_rev_id sink_rev_id
         mapping equivalent revision identifiers for each system."""
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def authorfile(self):
         """Path to a file that will contain lines
@@ -203,7 +203,7 @@
         a particular revision (or even what that revision would be)
         before it receives the file data.
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def puttags(self, tags):
         """Put tags into sink.
@@ -212,7 +212,7 @@
         Return a pair (tag_revision, tag_parent_revision), or (None, None)
         if nothing was changed.
         """
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def setbranch(self, branch, pbranches):
         """Set the current branch name. Called before the first putcommit
@@ -247,7 +247,7 @@
 
     def hascommit(self, rev):
         """Return True if the sink contains rev"""
-        raise NotImplementedError()
+        raise NotImplementedError
 
 class commandline(object):
     def __init__(self, ui, command):
--- a/hgext/convert/git.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/convert/git.py	Sat May 12 16:00:58 2012 +0200
@@ -69,7 +69,7 @@
 
     def catfile(self, rev, type):
         if rev == hex(nullid):
-            raise IOError()
+            raise IOError
         data, ret = self.gitread("git cat-file %s %s" % (type, rev))
         if ret:
             raise util.Abort(_('cannot read %r object at %s') % (type, rev))
--- a/hgext/convert/hg.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/convert/hg.py	Sat May 12 16:00:58 2012 +0200
@@ -241,7 +241,7 @@
             # try to provoke an exception if this isn't really a hg
             # repo, but some other bogus compatible-looking url
             if not self.repo.local():
-                raise error.RepoError()
+                raise error.RepoError
         except error.RepoError:
             ui.traceback()
             raise NoRepo(_("%s is not a local Mercurial repository") % path)
--- a/hgext/convert/monotone.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/convert/monotone.py	Sat May 12 16:00:58 2012 +0200
@@ -283,11 +283,11 @@
 
     def getfile(self, name, rev):
         if not self.mtnisfile(name, rev):
-            raise IOError() # file was deleted or renamed
+            raise IOError # file was deleted or renamed
         try:
             data = self.mtnrun("get_file_of", name, r=rev)
         except:
-            raise IOError() # file was deleted or renamed
+            raise IOError # file was deleted or renamed
         self.mtnloadmanifest(rev)
         node, attr = self.files.get(name, (None, ""))
         return data, attr
@@ -317,7 +317,7 @@
     def getchangedfiles(self, rev, i):
         # This function is only needed to support --filemap
         # ... and we don't support that
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def before(self):
         # Check if we have a new enough version to use automate stdio
--- a/hgext/convert/subversion.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/convert/subversion.py	Sat May 12 16:00:58 2012 +0200
@@ -870,7 +870,7 @@
     def getfile(self, file, rev):
         # TODO: ra.get_file transmits the whole file instead of diffs.
         if file in self.removed:
-            raise IOError()
+            raise IOError
         mode = ''
         try:
             new_module, revnum = revsplit(rev)[1:]
@@ -891,7 +891,7 @@
             notfound = (svn.core.SVN_ERR_FS_NOT_FOUND,
                 svn.core.SVN_ERR_RA_DAV_PATH_NOT_FOUND)
             if e.apr_err in notfound: # File not found
-                raise IOError()
+                raise IOError
             raise
         if mode == 'l':
             link_prefix = "link "
--- a/hgext/largefiles/lfcommands.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/largefiles/lfcommands.py	Sat May 12 16:00:58 2012 +0200
@@ -129,7 +129,7 @@
             try:
                 fctx = ctx.filectx(lfutil.standin(f))
             except error.LookupError:
-                raise IOError()
+                raise IOError
             renamed = fctx.renamed()
             if renamed:
                 renamed = lfutil.splitstandin(renamed[0])
@@ -229,7 +229,7 @@
             try:
                 fctx = ctx.filectx(srcfname)
             except error.LookupError:
-                raise IOError()
+                raise IOError
             renamed = fctx.renamed()
             if renamed:
                 # standin is always a largefile because largefile-ness
@@ -278,7 +278,7 @@
     try:
         fctx = ctx.filectx(f)
     except error.LookupError:
-        raise IOError()
+        raise IOError
     renamed = fctx.renamed()
     if renamed:
         renamed = renamed[0]
--- a/hgext/mq.py	Sat May 12 16:00:57 2012 +0200
+++ b/hgext/mq.py	Sat May 12 16:00:58 2012 +0200
@@ -322,7 +322,7 @@
         try:
             gitmode = ui.configbool('mq', 'git', None)
             if gitmode is None:
-                raise error.ConfigError()
+                raise error.ConfigError
             self.gitmode = gitmode and 'yes' or 'no'
         except error.ConfigError:
             self.gitmode = ui.config('mq', 'git', 'auto').lower()
--- a/mercurial/cmdutil.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/cmdutil.py	Sat May 12 16:00:58 2012 +0200
@@ -1360,7 +1360,7 @@
                                               copied=copied.get(path))
                     return mctx
                 except KeyError:
-                    raise IOError()
+                    raise IOError
         else:
             ui.note(_('copying changeset %s to %s\n') % (old, base))
 
@@ -1369,7 +1369,7 @@
                 try:
                     return old.filectx(path)
                 except KeyError:
-                    raise IOError()
+                    raise IOError
 
             # See if we got a message from -m or -l, if not, open the editor
             # with the message of the changeset to amend
--- a/mercurial/commandserver.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/commandserver.py	Sat May 12 16:00:58 2012 +0200
@@ -166,7 +166,7 @@
 
         # is the other end closed?
         if not data:
-            raise EOFError()
+            raise EOFError
 
         return data
 
--- a/mercurial/dagutil.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/dagutil.py	Sat May 12 16:00:58 2012 +0200
@@ -26,25 +26,25 @@
 
     def nodeset(self):
         '''set of all node idxs'''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def heads(self):
         '''list of head ixs'''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def parents(self, ix):
         '''list of parents ixs of ix'''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def inverse(self):
         '''inverse DAG, where parents becomes children, etc.'''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def ancestorset(self, starts, stops=None):
         '''
         set of all ancestors of starts (incl), but stop walk at stops (excl)
         '''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def descendantset(self, starts, stops=None):
         '''
@@ -59,7 +59,7 @@
         By "connected list" we mean that if an ancestor and a descendant are in
         the list, then so is at least one path connecting them.
         '''
-        raise NotImplementedError()
+        raise NotImplementedError
 
     def externalize(self, ix):
         '''return a list of (or set if given a set) of node ids'''
--- a/mercurial/hgweb/common.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/hgweb/common.py	Sat May 12 16:00:58 2012 +0200
@@ -95,7 +95,7 @@
     def __getattr__(self, attr):
         if attr in ('close', 'readline', 'readlines', '__iter__'):
             return getattr(self.f, attr)
-        raise AttributeError()
+        raise AttributeError
 
 def _statusmessage(code):
     from BaseHTTPServer import BaseHTTPRequestHandler
--- a/mercurial/keepalive.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/keepalive.py	Sat May 12 16:00:58 2012 +0200
@@ -534,7 +534,7 @@
         if self.auto_open:
             self.connect()
         else:
-            raise httplib.NotConnected()
+            raise httplib.NotConnected
 
     # send the data to the server. if we get a broken pipe, then close
     # the socket. we want to reconnect when somebody tries to send again.
--- a/mercurial/match.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/match.py	Sat May 12 16:00:58 2012 +0200
@@ -276,7 +276,7 @@
     try:
         pat = '(?:%s)' % '|'.join([_regex(k, p, tail) for (k, p) in pats])
         if len(pat) > 20000:
-            raise OverflowError()
+            raise OverflowError
         return pat, re.compile(pat).match
     except OverflowError:
         # We're using a Python with a tiny regex engine and we
--- a/mercurial/patch.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/patch.py	Sat May 12 16:00:58 2012 +0200
@@ -534,7 +534,7 @@
         if fname in self.data:
             return self.data[fname]
         if not self.opener or fname not in self.files:
-            raise IOError()
+            raise IOError
         fn, mode, copied = self.files[fname]
         return self.opener.read(fn), mode, copied
 
@@ -560,7 +560,7 @@
         try:
             fctx = self.ctx[fname]
         except error.LookupError:
-            raise IOError()
+            raise IOError
         flags = fctx.flags()
         return fctx.data(), ('l' in flags, 'x' in flags)
 
@@ -1628,7 +1628,7 @@
         try:
             def losedata(fn):
                 if not losedatafn or not losedatafn(fn=fn):
-                    raise GitDiffRequired()
+                    raise GitDiffRequired
             # Buffer the whole output until we are sure it can be generated
             return list(difffn(opts.copy(git=False), losedata))
         except GitDiffRequired:
--- a/mercurial/simplemerge.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/simplemerge.py	Sat May 12 16:00:58 2012 +0200
@@ -94,7 +94,7 @@
             elif self.a[0].endswith('\r'):
                 newline = '\r'
         if base_marker and reprocess:
-            raise CantReprocessAndShowBase()
+            raise CantReprocessAndShowBase
         if name_a:
             start_marker = start_marker + ' ' + name_a
         if name_b:
--- a/mercurial/win32.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/win32.py	Sat May 12 16:00:58 2012 +0200
@@ -305,7 +305,7 @@
     buf = ctypes.create_string_buffer(size + 1)
     len = _kernel32.GetModuleFileNameA(None, ctypes.byref(buf), size)
     if len == 0:
-        raise ctypes.WinError()
+        raise ctypes.WinError
     elif len == size:
         raise ctypes.WinError(_ERROR_INSUFFICIENT_BUFFER)
     return buf.value
@@ -315,7 +315,7 @@
     size = _DWORD(300)
     buf = ctypes.create_string_buffer(size.value + 1)
     if not _advapi32.GetUserNameA(ctypes.byref(buf), ctypes.byref(size)):
-        raise ctypes.WinError()
+        raise ctypes.WinError
     return buf.value
 
 _signalhandler = []
@@ -333,7 +333,7 @@
     h = _SIGNAL_HANDLER(handler)
     _signalhandler.append(h) # needed to prevent garbage collection
     if not _kernel32.SetConsoleCtrlHandler(h, True):
-        raise ctypes.WinError()
+        raise ctypes.WinError
 
 def hidewindow():
 
@@ -396,7 +396,7 @@
         None, args, None, None, False, _DETACHED_PROCESS,
         env, os.getcwd(), ctypes.byref(si), ctypes.byref(pi))
     if not res:
-        raise ctypes.WinError()
+        raise ctypes.WinError
 
     return pi.dwProcessId
 
--- a/mercurial/windows.py	Sat May 12 16:00:57 2012 +0200
+++ b/mercurial/windows.py	Sat May 12 16:00:58 2012 +0200
@@ -304,7 +304,7 @@
 
 def groupmembers(name):
     # Don't support groups on Windows for now
-    raise KeyError()
+    raise KeyError
 
 def isexec(f):
     return False
--- a/tests/test-commandserver.py	Sat May 12 16:00:57 2012 +0200
+++ b/tests/test-commandserver.py	Sat May 12 16:00:58 2012 +0200
@@ -18,7 +18,7 @@
 def readchannel(server):
     data = server.stdout.read(5)
     if not data:
-        raise EOFError()
+        raise EOFError
     channel, length = struct.unpack('>cI', data)
     if channel in 'IL':
         return channel, length