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 0bc7189 commit 8ca200b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sanic/touchup/schemes/ode.py
Original file line number Diff line number Diff line change
@@ -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 8ca200b

Please sign in to comment.