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 — gh-102033: Fix syntax error in `Tools/c-analyzer` by sobolevn · Pull Request #102066 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Feb 20, 2023 •
edited by miss-islington
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The easiest way to format strings with {} meaningful chars is via %.

  • Issue: Syntax error in _delim.py #102033

Automerge-Triggered-By: GH:ericsnowcurrently

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
pythongh-102033: Fix syntax error in Tools/c-analyzer
a930d37
@sobolevn
sobolevn requested a review from ericsnowcurrently February 20, 2023 08:00
@bedevere-bot bedevere-bot added the awaiting review label Feb 20, 2023
@bedevere-bot bedevere-bot mentioned this pull request Feb 20, 2023
Syntax error in _delim.py #102033
Closed
@sobolevn sobolevn added the skip news label Feb 20, 2023
@hauntsaninja

hauntsaninja commented Feb 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hmm, larger question than this PR, but if this has had a syntax error for the last three years, is it still useful?

Eclips4 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn added 2 commits February 20, 2023 13:54
@sobolevn
Remove unused parts from Tools/c-analyzer
f6026e6
@sobolevn
Trigger a warning
3dc3bd9
@sobolevn

sobolevn commented Feb 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@hauntsaninja good idea! I went trough all files in c-analyzer and:

  • Removed empty ones
  • Removed ones that are unused (like _dparse, _alt, _state_machine)
  • Removed unused imports
  • Removed unused variables

I double checked that:

  • It does not affect semantics
  • It does not affect runtime

To test that everyting is still working I've triggered 3dc3bd9 with a partial revert of #101657 to test the warning.

However, right now Lib/test/test_check_c_globals.py is disabled :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Remove extra warning
a1906bc
@sobolevn

sobolevn commented Feb 20, 2023

Copy link
Copy Markdown
Member Author

Any idea - why patchcheck fails?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hauntsaninja
Merge branch 'main' into issue-102033
6aa7f29
@hauntsaninja

hauntsaninja commented Feb 20, 2023 •
edited by AlexWaygood
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@sobolevn It wants you to apply this diff:

diff --git a/Tools/c-analyzer/cpython/_capi.py b/Tools/c-analyzer/cpython/_capi.py
index 5584677dae..dc453cb828 100644
--- a/Tools/c-analyzer/cpython/_capi.py
+++ b/Tools/c-analyzer/cpython/_capi.py
@@ -611,7 +611,7 @@ def _render_item_full(item, groupby, verbose):
     yield f'  {"filename:":10} {item.relfile}'
     for extra in ('kind', 'level'):
         #if groupby != extra:
-            yield f'  {extra+":":10} {getattr(item, extra)}'
+        yield f'  {extra+":":10} {getattr(item, extra)}'
     if verbose:
         print('  ---------------------------------------')
         for lno, line in enumerate(item.text, item.lno):
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Update _capi.py
be50672
@sobolevn

sobolevn commented Feb 20, 2023

Copy link
Copy Markdown
Member Author

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented Feb 21, 2023

Copy link
Copy Markdown
Member

I'm hesitant to do any significant cleanup on this tool before we've re-enabled the CI check for globals. Would you mind if we tabled this until then?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Feb 21, 2023

Copy link
Copy Markdown
Member Author

Sure, seems reasonable!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Merge branch 'main' into issue-102033
1c420a1
@sobolevn

sobolevn commented Mar 14, 2023

Copy link
Copy Markdown
Member Author

Since #102506 was merged, I think we can return to this PR.

Re-running the CI.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Mar 21, 2023

Copy link
Copy Markdown
Member Author

@ericsnowcurrently the CI passed with your new changes. What are the next steps?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently
ericsnowcurrently approved these changes Mar 21, 2023
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This change is almost entirely deleting unused code. I don't expect that any of that code is important to keep at this point. Thanks for doing this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Mar 21, 2023
@sobolevn

sobolevn commented Mar 22, 2023

Copy link
Copy Markdown
Member Author

Thanks everyone!

Is there anything else I need to do? :)
If not, can someone please click "merge"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently ericsnowcurrently added the 🤖 automerge label Mar 22, 2023
@miss-islington
miss-islington merged commit 1ca3155 into python:main Mar 22, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 22, 2023
@ericsnowcurrently

ericsnowcurrently commented Mar 22, 2023

Copy link
Copy Markdown
Member

Thanks again, @sobolevn!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@sobolevn @Fidget-Spinner
pythongh-102033: Fix syntax error in Tools/c-analyzer (pythonGH-102066
ae4c54b
)

The easiest way to format strings with `{}` meaningful chars is via `%`.
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@sobolevn @warsaw
pythongh-102033: Fix syntax error in Tools/c-analyzer (pythonGH-102066
3b92124
)

The easiest way to format strings with `{}` meaningful chars is via `%`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sobolevn @hauntsaninja @ericsnowcurrently @bedevere-bot @miss-islington
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.