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

Skip to content

Fix typos in variable names, function names, and comments #101868

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

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/zipimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def _read_directory(archive):

with fp:
# GH-87235: On macOS all file descriptors for /dev/fd/N share the same
# file offset, reset the file offset after scanning the zipfile diretory
# file offset, reset the file offset after scanning the zipfile directory
# to not cause problems when some runs 'python3 /dev/fd/9 9<some_script'
start_offset = fp.tell()
try:
Expand Down
2 changes: 1 addition & 1 deletion Mac/BuildScript/build-installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ def packageFromRecipe(targetDir, recipe):
IFPkgFlagRelocatable=False,
IFPkgFlagRestartAction="NoRestart",
IFPkgFlagRootVolumeOnly=True,
IFPkgFlagUpdateInstalledLangauges=False,
IFPkgFlagUpdateInstalledLanguages=False,
Copy link
Member

Choose a reason for hiding this comment

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

@python/macos-team Looks like a potentially impactful change here. Can you review?

Copy link
Member

Choose a reason for hiding this comment

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

This looks like a bug fix to me. If someone could demonstrate undesired behavior caused by this typo, it would warrant a bug report and a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

FTR, Ned responded here: #101868 (review)

)
writePlist(pl, os.path.join(packageContents, 'Info.plist'))

Expand Down
2 changes: 1 addition & 1 deletion PC/launcher2.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ typedef struct {
bool list;
// if true, only list detected runtimes with paths without launching
bool listPaths;
// if true, display help message before contiuning
// if true, display help message before continuing
bool help;
// if set, limits search to registry keys with the specified Company
// This is intended for debugging and testing only
Expand Down
2 changes: 1 addition & 1 deletion Parser/pegen_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype,

void
_Pypegen_set_syntax_error(Parser* p, Token* last_token) {
// Existing sintax error
// Existing syntax error
if (PyErr_Occurred()) {
// Prioritize tokenizer errors to custom syntax errors raised
// on the second phase only if the errors come from the parser.
Expand Down
12 changes: 6 additions & 6 deletions Tools/build/stable_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def gcc_get_limited_api_macros(headers):

api_hexversion = sys.version_info.major << 24 | sys.version_info.minor << 16

preprocesor_output_with_macros = subprocess.check_output(
Copy link
Member

Choose a reason for hiding this comment

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

Not sure who the current maintainer here would be (@encukou?) but someone should check that all references have been handled.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, me. I won't get to reviewing a typo in an internal variable name any time soon though. Generally we avoid such cosmetic changes, anyway.

preprocessor_output_with_macros = subprocess.check_output(
sysconfig.get_config_var("CC").split()
+ [
# Prevent the expansion of the exported macros so we can
Expand All @@ -540,7 +540,7 @@ def gcc_get_limited_api_macros(headers):
return {
target
for target in re.findall(
r"#define (\w+)", preprocesor_output_with_macros
r"#define (\w+)", preprocessor_output_with_macros
)
}

Expand All @@ -561,7 +561,7 @@ def gcc_get_limited_api_definitions(headers):
Requires Python built with a GCC-compatible compiler. (clang might work)
"""
api_hexversion = sys.version_info.major << 24 | sys.version_info.minor << 16
preprocesor_output = subprocess.check_output(
preprocessor_output = subprocess.check_output(
sysconfig.get_config_var("CC").split()
+ [
# Prevent the expansion of the exported macros so we can capture
Expand All @@ -581,13 +581,13 @@ def gcc_get_limited_api_definitions(headers):
stderr=subprocess.DEVNULL,
)
stable_functions = set(
re.findall(r"__PyAPI_FUNC\(.*?\)\s*(.*?)\s*\(", preprocesor_output)
re.findall(r"__PyAPI_FUNC\(.*?\)\s*(.*?)\s*\(", preprocessor_output)
)
stable_exported_data = set(
re.findall(r"__EXPORT_DATA\((.*?)\)", preprocesor_output)
re.findall(r"__EXPORT_DATA\((.*?)\)", preprocessor_output)
)
stable_data = set(
re.findall(r"__PyAPI_DATA\(.*?\)[\s\*\(]*([^);]*)\)?.*;", preprocesor_output)
re.findall(r"__PyAPI_DATA\(.*?\)[\s\*\(]*([^);]*)\)?.*;", preprocessor_output)
)
return stable_data | stable_exported_data | stable_functions

Expand Down
2 changes: 1 addition & 1 deletion Tools/c-analyzer/c_analyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


def analyze(filenmes, **kwargs):
results = iter_analyis_results(filenames, **kwargs)
results = iter_analysis_results(filenames, **kwargs)
return Analysis.from_results(results)


Expand Down
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def flush() -> None:
flush()
return tuple(version)

def version_comparitor(version1: str, version2: str) -> Literal[-1, 0, 1]:
def version_comparator(version1: str, version2: str) -> Literal[-1, 0, 1]:
iterator = itertools.zip_longest(
version_splitter(version1), version_splitter(version2), fillvalue=0
)
Expand Down Expand Up @@ -4840,7 +4840,7 @@ def reset(self) -> None:

def directive_version(self, required: str) -> None:
global version
if version_comparitor(version, required) < 0:
if version_comparator(version, required) < 0:
fail("Insufficient Clinic version!\n"
f" Version: {version}\n"
f" Required: {required}")
Expand Down