Skip to content

Wrong module name for -source mode. #63

@python-processing-unit

Description

@python-processing-unit

According to the specification section 12:

  • INT: MAIN() - Returns 1 when the call site belongs to the primary program file (the file passed as the interpreter's first argument, or <string> when -source is used). Returns 0 when executed from code that came from an IMPORT (including nested imports). The result is determined solely by the source file that contains the call expression, not by the caller's call stack.

In the implementation, however, the module name used when the interpreter is run in -source mode is <source>, not <string>.

& ".\prefix.exe" -source "ASSERT(0d0)"
Traceback (most recent call last):
  File "<source>", line 1, in <top-level>
    ASSERT(0d0)
    State log index: 0  State id: s_000000
RuntimeError: Assertion failed (rewrite: EXPR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions