- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
          gh-133059: fix Tools/build/deepfreeze.py nsmallposints
          #139906
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8a19633
              6355a5c
              ccfe160
              55b55ce
              e50f786
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import os | ||
|  | ||
| SCRIPT_NAME = 'Tools/build/consts_getter.py' | ||
| __file__ = os.path.abspath(__file__) | ||
|          | ||
| ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) | ||
|          | ||
| INTERNAL = os.path.join(ROOT, 'Include', 'internal') | ||
|  | ||
| def get_nsmallnegints_and_nsmallposints() -> tuple[int, int]: | ||
| nsmallposints = None | ||
| nsmallnegints = None | ||
| with open(os.path.join(INTERNAL, 'pycore_runtime_structs.h')) as infile: | ||
| for line in infile: | ||
| if line.startswith('#define _PY_NSMALLPOSINTS'): | ||
| nsmallposints = int(line.split()[-1]) | ||
| elif line.startswith('#define _PY_NSMALLNEGINTS'): | ||
| nsmallnegints = int(line.split()[-1]) | ||
| break | ||
| else: | ||
| raise NotImplementedError | ||
| assert nsmallposints | ||
| assert nsmallnegints | ||
| return nsmallnegints, nsmallposints | ||
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.
Is it needed?
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.
in this case, I think it's not. it's only used in scripts that generate .c files to put a comment on top to indicate that those file were generated by this particular script
will remove