Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctypes: Fix ctypesgencore for Python 3 #379

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/python/ctypes/ctypesgencore/parser/yacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,7 @@ def yacc(
raise YaccError("no rules of the form p_rulename are defined.")

# Sort the symbols by line number
symbols.sort(lambda x, y: cmp(get_func_code(x).co_firstlineno, get_func_code(y).co_firstlineno))
symbols.sort(key=lambda x: get_func_code(x).co_firstlineno)

# Add all of the symbols to the grammar
for f in symbols:
Expand All @@ -2288,7 +2288,7 @@ def yacc(
# Make a signature of the docstrings
for f in symbols:
if f.__doc__:
Signature.update(f.__doc__)
Signature.update(f.__doc__.encode("utf-8"))

lr_init_vars()

Expand Down