GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SciJava Python scripting: no final eval of assignments · scijava/scyjava@5d1efca

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/scyjava
    • _script.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/scyjava/_script.py‎

Copy file name to clipboardExpand all lines: src/scyjava/_script.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def apply(self, arg):
7575

7676
block = ast.parse(str(arg.script), mode="exec")
7777
last = None
78-
if len(block.body) > 0 and hasattr(block.body[-1], "value"):
78+
if (
79+
len(block.body) > 0
80+
and hasattr(block.body[-1], "value")
81+
and not isinstance(block.body[-1], ast.Assign)
82+
):
7983
# Last statement of the script looks like an expression. Evaluate!
8084
last = ast.Expression(block.body.pop().value)
8185

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.