.. _raising-bad-type:

raising-bad-type / E0702
========================

**Message emitted:**

Raising %s while only classes or instances are allowed

**Description:**

*Used when something which is neither a class nor an instance is raised (i.e. a `TypeError` will be raised).*

**Problematic code:**

.. literalinclude:: /data/messages/r/raising-bad-type/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/r/raising-bad-type/good.py
   :language: python



Created by the `exceptions <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/exceptions.py>`__ checker.