Skip to content

Commit

Permalink
Fix version compatibility issue in 'ode.py'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hamed committed Mar 25, 2024
1 parent b8ec9ed commit 9ff3ba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sanic/touchup/schemes/ode.py
@@ -1,3 +1,4 @@
import sys
from ast import Attribute, Await, Expr, NodeTransformer
from typing import Any, List

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

if isinstance(func, Attribute) and func.attr == "dispatch":
event = args[0]
if hasattr(event, "value"):
if hasattr(event, "value") if sys.version_info >= (3, 12) else hasattr(event, "s"):
event_name = getattr(event, "value", event.s)
if self._not_registered(event_name):
logger.debug(
Expand Down

0 comments on commit 9ff3ba6

Please sign in to comment.