diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-09-23 17:49:21 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-09-23 17:49:21 +0200 |
commit | 1a6ddcb14b8c8de81c849718e53be9b1f35813d9 (patch) | |
tree | 434c9bae9216cd459174f39b1faee27fc995c3e3 | |
parent | 0f3fb65ed680b9318d9fd83ec5e3130b8b61faf3 (diff) | |
download | pylint-git-1a6ddcb14b8c8de81c849718e53be9b1f35813d9.tar.gz |
Simplify the code to remove the need for a linter disable
-rw-r--r-- | pylint/checkers/strings.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index c287298c7..bb7e7d638 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -677,11 +677,14 @@ class StringConstantChecker(BaseTokenChecker): self.process_string_token(token, start_row) def process_string_token(self, token, start_row): + quote_char = None for i, c in enumerate(token): if c in "'\"": quote_char = c break - # pylint: disable=undefined-loop-variable + if quote_char is None: + return None + prefix = token[:i].lower() # markers like u, b, r. after_prefix = token[i:] if after_prefix[:3] == after_prefix[-3:] == 3 * quote_char: |