Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoortheen committed Jul 20, 2024
1 parent cd41d3e commit dbbee3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions peg_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def class_def_raw(self) -> ast.ClassDef | None:
keywords=b[1] if b else [],
body=c,
decorator_list=[],
**{"type_params": t} if t else {},
**{"type_params": t or []} if sys.version_info >= (3, 12) else {},
**self.span(_lnum, _col),
)
self._reset(mark)
Expand Down Expand Up @@ -615,7 +615,7 @@ def function_def_raw(self) -> ast.FunctionDef | ast.AsyncFunctionDef | None:
returns=a,
body=b,
type_comment=tc,
**{"type_params": t} if t else {},
**{"type_params": t or []} if sys.version_info >= (3, 12) else {},
**self.span(_lnum, _col),
)
self._reset(mark)
Expand All @@ -638,7 +638,7 @@ def function_def_raw(self) -> ast.FunctionDef | ast.AsyncFunctionDef | None:
returns=a,
body=b,
type_comment=tc,
**{"type_params": t} if t else {},
**{"type_params": t or []} if sys.version_info >= (3, 12) else {},
**self.span(_lnum, _col),
)
self._reset(mark)
Expand Down
7 changes: 4 additions & 3 deletions tasks/xonsh.gram
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class_def_raw[ast.ClassDef]:
keywords=b[1] if b else [],
body=c,
decorator_list=[],
**({'type_params': t} if t else {}),
**({'type_params': t or []} if sys.version_info >= (3, 12) else {}),
LOCATIONS,
)
)
Expand All @@ -252,7 +252,7 @@ function_def_raw[Union[ast.FunctionDef, ast.AsyncFunctionDef]]:
returns=a,
body=b,
type_comment=tc,
**({'type_params': t} if t else {}),
**({'type_params': t or []} if sys.version_info >= (3, 12) else {}),
LOCATIONS,
)
)
Expand All @@ -265,7 +265,8 @@ function_def_raw[Union[ast.FunctionDef, ast.AsyncFunctionDef]]:
returns=a,
body=b,
type_comment=tc,
**({'type_params': t} if t else {}),
**({'type_params': t or []} if sys.version_info >= (3, 12) else {}),

LOCATIONS,
)
)
Expand Down

0 comments on commit dbbee3a

Please sign in to comment.