Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8ca200b

Browse files
author
hamed
committedMar 25, 2024·
Fix version compatibility issue in 'ode.py'
Adjusted a condition in 'ode.py' to handle changes in sys.version_info from 3.12 onwards. This fix ensures compatibility with newer Python versions as system requirements are now checked before the execution of certain commands.
1 parent 0bc7189 commit 8ca200b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎sanic/touchup/schemes/ode.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from ast import Attribute, Await, Expr, NodeTransformer
23
from typing import Any, List
34

@@ -67,7 +68,7 @@ def visit_Expr(self, node: Expr) -> Any:
6768

6869
if isinstance(func, Attribute) and func.attr == "dispatch":
6970
event = args[0]
70-
if hasattr(event, "value"):
71+
if hasattr(event, "value") if sys.version_info >= (3, 12) else hasattr(event, "s"):
7172
event_name = getattr(event, "value", event.s)
7273
if self._not_registered(event_name):
7374
logger.debug(

0 commit comments

Comments
 (0)
Please sign in to comment.