Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stubgen reports wrong Python version when used with debug f-string #10905

Description

@Peterl777

Bug Report

When running stubgen on a module that contains a debug f-string, stubgen reports a "Critical error" and reports the wrong python version.

To Reproduce

# mod.py
def fn() -> int:
    i = 5
    print(f'{i=}')
    return 0

C:\> stubgen mod.py
Critical error during semantic analysis: mod.py:3: error: f-string: self documenting expressions are only supported in Python 3.8 and greater

Expected Behavior

C:\> stubgen mod.py
Processed 1 modules
Generated out\mod.pyi

Actual Behavior

C:\> stubgen mod.py
Critical error during semantic analysis: mod.py:3: error: f-string: self documenting expressions are only supported in Python 3.8 and greater

Your Environment

  • Mypy version used: 0.910
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.9.6 (no other Pythons installed)
  • Operating system and version: Win 10.0.19043

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions