Skip to content

Commit

Permalink
CLI nits
Browse files Browse the repository at this point in the history
also remove a pass in an empty method with docstring, because all other
such methods don't
  • Loading branch information
mara004 committed Jan 27, 2024
1 parent a1081b7 commit 01e6c95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/ctypesgen/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
1 change: 0 additions & 1 deletion src/ctypesgen/parser/cparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 01e6c95

Please sign in to comment.