
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
The ``++raise a, b++`` syntax is deprecated in Python 3, and should no longer be used.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
try:
|
|
if not is_okay:
|
|
raise Exception, 'It\'s not okay' # Noncompliant
|
|
except Exception as e:
|
|
# ...
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python]
|
|
----
|
|
try:
|
|
if not is_okay:
|
|
raise Exception('It\'s not okay')
|
|
except Exception as e:
|
|
# ...
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Use "x" to raise an exception here.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 21 Apr 2015, 09:07:09 Elena Vilchik wrote:
|
|
\[~ann.campbell.2] I changed the message. For code example it could be "Use "Exception('It's not okay')" to raise an exception here." wdyt?
|
|
|
|
=== on 21 Apr 2015, 09:24:19 Ann Campbell wrote:
|
|
\[~elena.vilchik] that message is fine with me. Note, however, that in the past we've steered away from such messages because of potential message length. Limitations in the platform - which have since been removed - were partly responsible for that.
|
|
|
|
endif::env-github,rspecator-view[]
|