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 — vm: with statement ignores a true non-bool __exit__ result · Issue #267 · go-python/gpython

vm: with statement ignores a true non-bool __exit__ result #267

New issue
Copy link
New issue
Copy link
Open
#269
Open
vm: with statement ignores a true non-bool __exit__ result#267
#269
Copy link

Description

@drew-512
drew-512
opened on Nov 10, 2026
Issue body actions

An __exit__ that returns a true value other than True does not silence the exception:

class Quiet:
    def __enter__(self):
        return self
    def __exit__(self, *exc):
        return 1

with Quiet():
    raise ValueError("boom")

print("ok")

On main (444ae5e):

ValueError: 'boom'

CPython prints ok: its WITH_CLEANUP tests the result with PyObject_IsTrue, while gpython's (vm/eval.go) compares it with py.True.

Go 1.27.1, darwin/arm64.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.