Skip to content

Commit

Permalink
Put exception type before the colon in @raise documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mthuurne committed Oct 21, 2020
1 parent 78fd815 commit 2a745a3
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/twisted/_threads/_ithreads.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def quit():
Free any resources associated with this L{IWorker} and cause it to
reject all future work.
@raise: L{AlreadyQuit} if this method has already been called.
@raise AlreadyQuit: if this method has already been called.
"""


Expand Down
2 changes: 1 addition & 1 deletion src/twisted/internet/_glibbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def ensureNotImported(moduleNames, errorMessage, preventImports=[]):
@param errorMessage: Message to use when raising an C{ImportError}.
@type errorMessage: C{str}
@raises: C{ImportError} with given error message if a given module name
@raise ImportError: with given error message if a given module name
has already been imported.
"""
for name in moduleNames:
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/internet/_sslverify.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def peerFromTransport(Class, transport):
@rtype: C{Class}
@raise: L{CertificateError}, if the given transport does not have a peer
@raise CertificateError: if the given transport does not have a peer
certificate.
"""
return _handleattrhelper(Class, transport, "peer")
Expand All @@ -491,7 +491,7 @@ def hostFromTransport(Class, transport):
@rtype: C{Class}
@raise: L{CertificateError}, if the given transport does not have a host
@raise CertificateError: if the given transport does not have a host
certificate.
"""
return _handleattrhelper(Class, transport, "host")
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/names/_rfc1982.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _convertOther(self, other: object) -> "SerialNumber":
@param other: The foreign L{object} to be checked.
@return: C{other} after compatibility checks and possible coercion.
@raises: L{TypeError} if C{other} is not compatible.
@raise TypeError: If C{other} is not compatible.
"""
if not isinstance(other, SerialNumber):
raise TypeError("cannot compare or combine %r and %r" % (self, other))
Expand Down Expand Up @@ -193,7 +193,7 @@ def __add__(self, other: object) -> "SerialNumber":
@see: U{http://tools.ietf.org/html/rfc1982#section-3.1}
@raises: L{ArithmeticError} if C{other} is more than C{_maxAdd}
@raise ArithmeticError: If C{other} is more than C{_maxAdd}
ie more than half the maximum value of this serial number.
"""
try:
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/python/_shellcomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def writeExtras(self):
@return: L{None}
@raises: ValueError: if C{Completer} with C{repeat=True} is found and
@raise ValueError: If C{Completer} with C{repeat=True} is found and
is not the last item in the C{extraActions} list.
"""
for i, action in enumerate(self.extraActions):
Expand All @@ -408,7 +408,7 @@ def verifyZshNames(self):
"""
Ensure that none of the option names given in the metadata are typoed
@return: L{None}
@raise ValueError: Raised if unknown option names have been found.
@raise ValueError: If unknown option names have been found.
"""

def err(name):
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/python/filepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def segmentsFrom(self, ancestor):
@param ancestor: an instance of the same class as self, ostensibly an
ancestor of self.
@raise: ValueError if the 'ancestor' parameter is not actually an
@raise ValueError: If the C{ancestor} parameter is not actually an
ancestor, i.e. a path for /x/y/z is passed as an ancestor for /a/b/c/d.
@return: a list of strs
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/python/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __getitem__(self, modname):
to retrieve this module.
@raise: KeyError if the module is not found.
@raise KeyError: if the module is not found.
@return: a PythonModule.
"""
Expand Down
3 changes: 1 addition & 2 deletions src/twisted/python/test/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,7 @@ def verifyFileExists(self, fileDir, fileName):
C{fileDir}.
@type fileName: L{str}
@raise: L{FailTest <twisted.trial.unittest.FailTest>} if
C{fileDir.child(fileName)}:
@raise FailTest: If C{fileDir.child(fileName)}:
1. Does not exist.
Expand Down
3 changes: 1 addition & 2 deletions src/twisted/runner/procmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ def addProcess(self, name, args, uid=None, gid=None, env={}, cwd=None):
The default of C{None} means inheriting the laucnhing process's
working directory.
@type env: C{dict}
@raises: C{KeyError} if a process with the given name already
exists
@raise KeyError: If a process with the given name already exists.
"""
if name in self._processes:
raise KeyError("remove %s first" % (name,))
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/trial/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def loadPackage(self, package, recurse=False):
within the given package (and so on), otherwise, only inspect modules
in the package itself.
@raise: TypeError if 'package' is not a package.
@raise TypeError: If C{package} is not a package.
@return: a TestSuite created with my suiteFactory, containing all the
tests.
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/web/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def getSession(self, uid):
@param uid: Unique ID of the session.
@type uid: L{bytes}.
@raise: L{KeyError} if the session is not found.
@raise KeyError: If the session is not found.
"""
return self.sessions[uid]

Expand Down

0 comments on commit 2a745a3

Please sign in to comment.