Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-29849: fix memory leak in import_from#712

Merged
zhangyangyu merged 4 commits into
python:masterpython/cpython:masterfrom
zhangyangyu:bpo-29849zhangyangyu/cpython:bpo-29849Copy head branch name to clipboard
Mar 21, 2017
Merged

bpo-29849: fix memory leak in import_from#712
zhangyangyu merged 4 commits into
python:masterpython/cpython:masterfrom
zhangyangyu:bpo-29849zhangyangyu/cpython:bpo-29849Copy head branch name to clipboard

Conversation

@zhangyangyu

Copy link
Copy Markdown
Member

No description provided.

@zhangyangyu zhangyangyu added the type-bug An unexpected behavior, bug, or error label Mar 18, 2017
@mention-bot

Copy link
Copy Markdown

@zhangyangyu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @serhiy-storchaka and @1st1 to be potential reviewers.

@brettcannon

Copy link
Copy Markdown
Member

The Travis failures were probably due to GH-697 which has now been fixed in GH-718. Please rebase your branch to pick up the change.

@brettcannon brettcannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor doc removal, otherwise LGTM.

Comment thread Python/ceval.c Outdated
"cannot import name %R from %R (unknown location)",
name, pkgname_or_unknown
);
/* doesn't check NULL for errmsg, PyErr_SetImportError will catch */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think the comment is necessary long-term.

@zhangyangyu zhangyangyu Mar 20, 2017

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This comment is to make others know the error check is left out deliberately. It is not an oversight.
Do you think it's a must to remove it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you want to keep it then please change it to "/* NULL check for errmsg done by PyErr_SetImportError. */".

Comment thread Python/ceval.c Outdated
);
/* doesn't check NULL for errmsg, PyErr_SetImportError will catch */
PyErr_SetImportError(errmsg, pkgname, NULL);
} else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While you're here you might as well fix the formatting for this.

Comment thread Python/ceval.c Outdated
"cannot import name %R from %R (unknown location)",
name, pkgname_or_unknown
);
/* doesn't check NULL for errmsg, PyErr_SetImportError will catch */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you want to keep it then please change it to "/* NULL check for errmsg done by PyErr_SetImportError. */".

Comment thread Python/ceval.c
"cannot import name %R from %R (%S)",
name, pkgname_or_unknown, pkgpath
);
PyErr_SetImportError(errmsg, pkgname, pkgpath);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Need a similar comment here if you are going to leave it in.

@zhangyangyu zhangyangyu merged commit 4830f58 into python:master Mar 21, 2017
@zhangyangyu zhangyangyu deleted the bpo-29849 branch March 21, 2017 03:13
@zhangyangyu

Copy link
Copy Markdown
Member Author

Thanks @serhiy-storchaka and @brettcannon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.