Fix off-by-one indentation error
This commit is contained in:
parent
fd91896d80
commit
0a3078f1cc
36
pep-3109.txt
36
pep-3109.txt
|
@ -215,24 +215,24 @@ The following translations will be performed:
|
|||
except E as V:
|
||||
handle(V)
|
||||
|
||||
2. ``raise E, V`` as a way of "casting" an exception to another
|
||||
class. Taking an example from
|
||||
distutils.compiler.unixcompiler ::
|
||||
|
||||
try:
|
||||
self.spawn(pp_args)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
This would be better expressed as ::
|
||||
|
||||
try:
|
||||
self.spawn(pp_args)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError from msg
|
||||
|
||||
Using the ``raise ... from ...`` syntax introduced in
|
||||
PEP 344.
|
||||
2. ``raise E, V`` as a way of "casting" an exception to another
|
||||
class. Taking an example from
|
||||
distutils.compiler.unixcompiler ::
|
||||
|
||||
try:
|
||||
self.spawn(pp_args)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
This would be better expressed as ::
|
||||
|
||||
try:
|
||||
self.spawn(pp_args)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError from msg
|
||||
|
||||
Using the ``raise ... from ...`` syntax introduced in
|
||||
PEP 344.
|
||||
|
||||
|
||||
References
|
||||
|
|
Loading…
Reference in New Issue