Skip to content

bpo-30028: os.getpid() is always available#1074

Closed
vstinner wants to merge 1 commit intopython:masterfrom
vstinner:logging_getpid
Closed

bpo-30028: os.getpid() is always available#1074
vstinner wants to merge 1 commit intopython:masterfrom
vstinner:logging_getpid

Conversation

@vstinner
Copy link
Copy Markdown
Member

Remove hasattr(os, 'getpid') from logging.LogRecord constructor. The
test was added in 2003 with the commit 4c641d0: "getpid doesn't
exist on MacOS9", but Python 3.7 doesn't support MacOS9 anymore.

Remove hasattr(os, 'getpid') from logging.LogRecord constructor. The
test was added in 2003 with the commit 4c641d0: "getpid doesn't
exist on MacOS9", but Python 3.7 doesn't support MacOS9 anymore.
@mention-bot
Copy link
Copy Markdown

@Haypo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vsajip, @benjaminp and @nnorwitz to be potential reviewers.

@vstinner
Copy link
Copy Markdown
Member Author

"test.support uses [os.getpid()] unconditionally in various places. See https://github.com/python/cpython/blob/master/Lib/test/support/__init__.py#L803 for an example."
http://bugs.python.org/issue30028#msg291417

@vstinner
Copy link
Copy Markdown
Member Author

The current code works well, whereas my change breaks the CloudABI. I prefer to keep the cheap test rather than breaking CloudABI, so I abandon my change.
http://bugs.python.org/issue30028#msg291422

@vstinner vstinner closed this Apr 10, 2017
@vstinner vstinner deleted the logging_getpid branch April 10, 2017 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants