From 01e6c953ab49839415609e12c1df417210b869e6 Mon Sep 17 00:00:00 2001 From: geisserml Date: Sat, 27 Jan 2024 14:14:20 +0100 Subject: [PATCH] CLI nits also remove a pass in an empty method with docstring, because all other such methods don't --- src/ctypesgen/__main__.py | 12 ++++++------ src/ctypesgen/parser/cparser.py | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ctypesgen/__main__.py b/src/ctypesgen/__main__.py index 26dba273..7df99901 100644 --- a/src/ctypesgen/__main__.py +++ b/src/ctypesgen/__main__.py @@ -347,19 +347,19 @@ def __call__(self, parser, namespace, values, option_string=None): args.cppargs = list( itertools.chain(*args.cppargs) ) - # important: must not use +=, this would mutate the original object, which is problematic when calling ctypesgen natively from the python API + # Important: must not use +=, this would mutate the original object, which is problematic when default=[] is used and ctypesgen called repeatedly from within python args.compile_libdirs = args.compile_libdirs + args.universal_libdirs args.runtime_libdirs = args.runtime_libdirs + args.universal_libdirs - # Figure out what names will be defined by imported Python modules + # Figure out what names will be defined by linked-in python modules args.linked_symbols = find_symbols_in_modules(args.modules, args.output) - printer = {"py": printer_python, "json": printer_json}[args.output_language].WrapperPrinter - descs = core_parser.parse(args.headers, args) - processor.process(descs, args) - data = [(k, d) for k, d in descs.output_order if d.included] + data = core_parser.parse(args.headers, args) + processor.process(data, args) + data = [(k, d) for k, d in data.output_order if d.included] if not data: raise RuntimeError("No target members found.") + printer = {"py": printer_python, "json": printer_json}[args.output_language].WrapperPrinter printer(args.output, args, data, given_argv) msgs.status_message("Wrapping complete.") diff --git a/src/ctypesgen/parser/cparser.py b/src/ctypesgen/parser/cparser.py index fa19741f..62a8e7a0 100755 --- a/src/ctypesgen/parser/cparser.py +++ b/src/ctypesgen/parser/cparser.py @@ -198,7 +198,6 @@ def handle_declaration(self, declaration, filename, lineno): `declaration` is an instance of Declaration. Where a declaration has multiple initialisers, each is returned as a separate declaration. """ - pass class DebugCParser(CParser):