rspec/rules/S2838/python/rule.adoc
2022-02-04 16:28:24 +00:00

43 lines
650 B
Plaintext

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)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]