@@ -126,12 +126,9 @@ The following exceptions are the exceptions that are actually raised.
126126
127127 .. exception :: EOFError
128128
129- Raised when attempting to read beyond the end of a file. (N.B.: the :meth: `read `
130- and :meth: `readline ` methods of file objects return an empty string when they
131- hit EOF.)
132-
133- .. % XXXJH xrefs here
134- .. % XXXJH xrefs here
129+ Raised when attempting to read beyond the end of a file. (N.B.: the
130+ :meth: `file.read ` and :meth: `file.readline ` methods return an empty string
131+ when they hit EOF.)
135132
136133
137134.. exception :: FloatingPointError
@@ -154,12 +151,10 @@ The following exceptions are the exceptions that are actually raised.
154151
155152.. exception :: IOError
156153
157- Raised when an I/O operation (such as a :keyword : `print ` statement, the built-in
158- :func: `open ` function or a method of a file object) fails for an I/O-related
154+ Raised when an I/O operation (such as the built-in :func : `print ` or
155+ :func: `open ` functions or a method of a file object) fails for an I/O-related
159156 reason, e.g., "file not found" or "disk full".
160157
161- .. % XXXJH xrefs here
162-
163158 This class is derived from :exc: `EnvironmentError `. See the discussion above
164159 for more information on exception instance attributes.
165160
@@ -169,8 +164,6 @@ The following exceptions are the exceptions that are actually raised.
169164 Raised when an :keyword: `import ` statement fails to find the module definition
170165 or when a ``from ... import `` fails to find a name that is to be imported.
171166
172- .. % XXXJH xref to import statement?
173-
174167
175168.. exception :: IndexError
176169
@@ -191,12 +184,10 @@ The following exceptions are the exceptions that are actually raised.
191184 .. exception :: KeyboardInterrupt
192185
193186 Raised when the user hits the interrupt key (normally :kbd: `Control - C ` or
194- :kbd: `Delete `). During execution, a check for interrupts is made regularly. The
195- exception inherits from :exc: `BaseException ` so as to not be accidentally caught
196- by code that catches :exc: `Exception ` and thus prevent the interpreter from
197- exiting.
198-
199- .. % XXX(hylton) xrefs here
187+ :kbd: `Delete `). During execution, a check for interrupts is made
188+ regularly. The exception inherits from :exc: `BaseException ` so as to not be
189+ accidentally caught by code that catches :exc: `Exception ` and thus prevent
190+ the interpreter from exiting.
200191
201192 .. versionchanged :: 2.5
202193 Changed to inherit from :exc: `BaseException `.
@@ -246,11 +237,7 @@ The following exceptions are the exceptions that are actually raised.
246237 represented. This cannot occur for long integers (which would rather raise
247238 :exc: `MemoryError ` than give up). Because of the lack of standardization of
248239 floating point exception handling in C, most floating point operations also
249- aren't checked. For plain integers, all operations that can overflow are
250- checked except left shift, where typical applications prefer to drop bits than
251- raise an exception.
252-
253- .. % XXXJH reference to long's and/or int's?
240+ aren't checked.
254241
255242
256243.. exception :: ReferenceError
@@ -290,8 +277,6 @@ The following exceptions are the exceptions that are actually raised.
290277 or :func: `eval `, or when reading the initial script or standard input
291278 (also interactively).
292279
293- .. % XXXJH xref to these functions?
294-
295280 Instances of this class have attributes :attr: `filename `, :attr: `lineno `,
296281 :attr: `offset ` and :attr: `text ` for easier access to the details. :func: `str `
297282 of the exception instance returns only the message.
@@ -319,8 +304,6 @@ The following exceptions are the exceptions that are actually raised.
319304 it has another type (such as a string), the object's value is printed and the
320305 exit status is one.
321306
322- .. % XXX(hylton) xref to module sys?
323-
324307 Instances have an attribute :attr: `code ` which is set to the proposed exit
325308 status or error message (defaulting to ``None ``). Also, this exception derives
326309 directly from :exc: `BaseException ` and not :exc: `Exception `, since it is not
0 commit comments