From 785e3215abc6224ededa13a94964923f9e3064c7 Mon Sep 17 00:00:00 2001 From: "deepsource-enterprise-internal[bot]" <111794875+deepsource-enterprise-internal[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 13:28:01 +0000 Subject: [PATCH] refactor: change `NotImplemented` to `NotImplementedError` While returning `NotImplemented` would be fine, raising it doesn't work and will cause a `TypeError` because `NotImplemented` is not an exception type. --- sample.py | 2 +- sample_without_trailing_newline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample.py b/sample.py index 7321e47..c400289 100644 --- a/sample.py +++ b/sample.py @@ -29,4 +29,4 @@ def dummy_function(): def new_dummy_function(): print('foobar') - raise NotImplemented # skipcq: pyl-e0702 + raise NotImplementedError # skipcq: pyl-e0702 diff --git a/sample_without_trailing_newline.py b/sample_without_trailing_newline.py index 7ef4537..bc7aa13 100644 --- a/sample_without_trailing_newline.py +++ b/sample_without_trailing_newline.py @@ -33,4 +33,4 @@ def dummy_function(): def new_dummy_function(): print('foobar') # This is a comment, we test whether the next line gets highlighted - raise NotImplemented # raise an issue here + raise NotImplementedError # raise an issue here