Skip to content

Commit 1f5ba1b

Browse files
authored
Various fixes after running pylint (#71)
1 parent 0280e8d commit 1f5ba1b

File tree

5 files changed

+2
-9
lines changed

5 files changed

+2
-9
lines changed

cxxheaderparser/gentest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import argparse
22
import dataclasses
33
import inspect
4-
import re
54
import subprocess
65
import typing
76

@@ -72,7 +71,7 @@ def gentest(
7271
data = parse_string(content, options=options)
7372
if fail:
7473
raise ValueError("did not fail")
75-
except CxxParseError as e:
74+
except CxxParseError:
7675
if not fail:
7776
raise
7877
# do it again, but strip the content so the error message matches

cxxheaderparser/lexer.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import contextlib
2-
from collections import deque
31
import re
42
import typing
53
import sys
@@ -838,8 +836,6 @@ def has_tokens(self) -> bool:
838836
return len(self.tokbuf) > 0
839837

840838
def _fill_tokbuf(self, tokbuf: typing.Deque[LexToken]) -> bool:
841-
from .errors import CxxParseError
842-
843839
raise CxxParseError("no more tokens left in this group")
844840

845841
def current_location(self) -> Location:

cxxheaderparser/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(
9494
)
9595
self.anon_id = 0
9696

97-
self.verbose = True if self.options.verbose else False
97+
self.verbose = self.options.verbose
9898
if self.verbose:
9999

100100
def debug_print(fmt: str, *args: typing.Any) -> None:

cxxheaderparser/preprocessor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import io
66
import re
77
import os
8-
from os.path import relpath
98
import typing
109
from .options import PreprocessorFunction
1110

cxxheaderparser/simple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
)
5151

5252
from .parserstate import (
53-
State,
5453
ClassBlockState,
5554
ExternBlockState,
5655
NamespaceBlockState,

0 commit comments

Comments
 (0)