From 45db0a377f6eed8e8d39f5a97f0b461a60828e6d Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Tue, 10 Dec 2024 09:23:11 +0000 Subject: [PATCH] fix: remove use of deprecated Ellipsis Closes https://github.com/quantinuum-dev/guppy-integration/issues/33 --- guppylang/ast_util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guppylang/ast_util.py b/guppylang/ast_util.py index 309496bf..99231473 100644 --- a/guppylang/ast_util.py +++ b/guppylang/ast_util.py @@ -343,4 +343,8 @@ def has_empty_body(func_ast: ast.FunctionDef) -> bool: if len(func_ast.body) > 1: return False [n] = func_ast.body - return isinstance(n, ast.Expr) and isinstance(n.value, ast.Ellipsis) + return ( + isinstance(n, ast.Expr) + and isinstance(n.value, ast.Constant) + and n.value.value == Ellipsis + )