When raising an exception in an except block without as/from, the Python Analyzer gives feedback with inline code that is surrounded by single quotes instead of backticks:
Analyzer Feedback
Line 23 [W0707 raise-missing-from] was reported by Pylint:
Consider explicitly re-raising using ‘except Exception as exc’ and ‘raise ValueError('syntax error') from exc’.
There is an issue in the code that could lead to a bug or error in the program. While this error might not be severe, it could lead to more severe issues in the future. It is recommended the problem be addressed before proceeding further.
Instead of:
try:
1 / 0
except ZeroDivisionError as e:
raise ValueError("Rectangle Area cannot be zero") # [raise-missing-from]
Try:
try:
1 / 0
except ZeroDivisionError as e:
raise ValueError("Rectangle Area cannot be zero") from e
This is especially confusing in this case, as the code also has single quotes in it.