Skip to content

Commit

Permalink
fix auto solve for python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
idanpa committed Apr 12, 2024
1 parent 338ccca commit d57a728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12",]
python-version: ["3.9", "3.10", "3.11", "3.12",]
os: [windows-latest, macOS-latest, ubuntu-latest,]

steps:
Expand Down
2 changes: 1 addition & 1 deletion calcpy/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def auto_prod_replace(match):
try:
ip.compile.ast_parse(code)
except Exception as e:
if isinstance(e, SyntaxError) and 'cannot assign to expression' in str(e):
if isinstance(e, SyntaxError) and 'cannot assign to ' in str(e):
code = re.sub(r'(.*[^=])=([^=].*)', r'solve(Eq(\1, \2))', code)

if ip.calcpy._print_transformed_code:
Expand Down

0 comments on commit d57a728

Please sign in to comment.