python-by-example-150-chall.../venv/lib/python3.6/site-packages/pylint/test/functional/indexing_exception.py

16 lines
392 B
Python
Raw Normal View History

2019-08-04 20:26:35 +08:00
"""
Check for indexing exceptions.
"""
# pylint: disable=import-error, no-absolute-import
from unknown import ExtensionException
__revision__ = 0
class SubException(IndexError):
""" empty """
_ = IndexError("test")[0] # [indexing-exception]
_ = ZeroDivisionError("error")[0] # [indexing-exception]
_ = ExtensionException("error")[0]
_ = SubException("error")[1] # [indexing-exception]