Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 676
    • Issues 676
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

April 05-07 - Mercurial Paris Conference 2023 - One day of workshop dedicated to Heptapod and Mercurial usage and workflow. There are still places available for both workshops and talks!

  • PyPyPyPy
  • pypypypy
  • Issues
  • #3873
Closed
Open
Issue created Dec 18, 2022 by narpfel@narpfel

pypy3.9: Wrong error message/location for generator expression followed by missing indent

Hi!

This code produces a misleading syntax error in PyPy3.9 (but not in PyPy2, PyPy3.8 and CPython 3.8+):

max(x for x in [])

if False:
missing_indent
$ pypy3 --version
Python 3.9.15 (21401ebc2df332b6be6e3d364a985e951a72bbbd, Dec 07 2022, 01:39:58)
[PyPy 7.3.10 with GCC 12.2.0]
$ pypy3 t.py
  File "/tmp/t.py", line 1
    max(x for x in [])
        ^
SyntaxError: Generator expression must be parenthesized
$ /tmp/pypy3.8-v7.3.10-linux64/bin/pypy3 -V
Python 3.8.15 (c20fe3f310f1d209d69a71d903dd17e5c3cf0de9, Dec 05 2022, 15:20:08)
[PyPy 7.3.10 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]
$ /tmp/pypy3.8-v7.3.10-linux64/bin/pypy3 t.py
  File "t.py", line 4
    missing_indent
    ^
IndentationError: expected an indented block after 'if' statement on line 3
$ python3 -VV
Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0]
$ python3 t.py
  File "/tmp/t.py", line 4
    missing_indent
    ^
IndentationError: expected an indented block after 'if' statement on line 3

When I originally found this, the missing indent was near the bottom of the file and the genexp was near the top, so it appears that this bug happens regardless of what is in between.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking