Various fixes after running pylint (#71)

This commit is contained in:
seladb 2023-10-03 23:57:34 -07:00 committed by GitHub
parent 0280e8d7e1
commit 1f5ba1b3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 9 deletions

View File

@ -1,7 +1,6 @@
import argparse
import dataclasses
import inspect
import re
import subprocess
import typing
@ -72,7 +71,7 @@ def gentest(
data = parse_string(content, options=options)
if fail:
raise ValueError("did not fail")
except CxxParseError as e:
except CxxParseError:
if not fail:
raise
# do it again, but strip the content so the error message matches

View File

@ -1,5 +1,3 @@
import contextlib
from collections import deque
import re
import typing
import sys
@ -838,8 +836,6 @@ class BoundedTokenStream(TokenStream):
return len(self.tokbuf) > 0
def _fill_tokbuf(self, tokbuf: typing.Deque[LexToken]) -> bool:
from .errors import CxxParseError
raise CxxParseError("no more tokens left in this group")
def current_location(self) -> Location:

View File

@ -94,7 +94,7 @@ class CxxParser:
)
self.anon_id = 0
self.verbose = True if self.options.verbose else False
self.verbose = self.options.verbose
if self.verbose:
def debug_print(fmt: str, *args: typing.Any) -> None:

View File

@ -5,7 +5,6 @@ Contains optional preprocessor support via pcpp
import io
import re
import os
from os.path import relpath
import typing
from .options import PreprocessorFunction

View File

@ -50,7 +50,6 @@ from .types import (
)
from .parserstate import (
State,
ClassBlockState,
ExternBlockState,
NamespaceBlockState,