FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-1635741 port signalmodule to multi-phase init (PEP 489) by koubaa · Pull Request #22049 · python/cpython · GitHub

Repository navigation

bpo-1635741 port signalmodule to multi-phase init (PEP 489) - #22049

Merged
vstinner merged 4 commits into
python:masterfrom
koubaa:bpo-1635741-signalmodule
Sep 3, 2020
Merged

vstinner merged 4 commits into
python:masterfrom
koubaa:bpo-1635741-signalmodule

Conversation

koubaa commented Sep 1, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

koubaa commented Sep 1, 2020

Copy link
Copy Markdown
Contributor Author

@vstinner @shihai1991 I split this from the other PR

Comment thread Modules/signalmodule.c Outdated
return -1;
}
Py_INCREF((PyObject*) &SiginfoType);
PyModule_AddObject(m, "struct_siginfo", (PyObject*) &SiginfoType);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please check for error. On error, DECREF is needed.

@@ -0,0 +1,2 @@
Port the :mod:`signalmodule` extension module to multi-phase initialization

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The module is called "_signal":

Suggested change
Port the :mod:`signalmodule` extension module to multi-phase initialization
Port the :mod:`_signal` extension module to multi-phase initialization

Comment thread Modules/signalmodule.c Outdated
/* add the functions */
#if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
if (!initialized) {
if (PyStructSequence_InitType2(&SiginfoType, &struct_siginfo_desc) < 0)

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would be nice to convert the static type SiginfoType to a heap type, but it can be done later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@vstinner what is the procedure for types defined using PyStructSequence_InitType2?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't know.

Comment thread Modules/signalmodule.c Outdated
return -1;
}
Py_INCREF((PyObject*) &SiginfoType);
PyModule_AddObject(m, "struct_siginfo", (PyObject*) &SiginfoType);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe you can use PyModule_AddType() in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@shihai1991 good idea, this simplifies the error handling too.

vstinner merged commit 71d1bd9 into python:master Sep 3, 2020

vstinner commented Sep 4, 2020

Copy link
Copy Markdown
Member

This change introduced a regression: https://bugs.python.org/issue41713

vstinner commented Sep 4, 2020

Copy link
Copy Markdown
Member

I partially reverted this change with PR #22087 to quickly fix https://bugs.python.org/issue41713.

shihai1991 added a commit to shihai1991/cpython that referenced this pull request Sep 5, 2020
…lots1

* origin/master: (63 commits)
  bpo-41627: Distinguish 32 and 64-bit user site packages on Windows (pythonGH-22098)
  bpo-38585: Remove references to defusedexpat (pythonGH-22095)
  bpo-41721: Add xlc options (pythonGH-22096)
  bpo-40486: Specify what happens if directory content change diring iteration (pythonGH-22025)
  bpo-41638: Improve ProgrammingError message for absent parameter. (pythonGH-21999)
  bpo-41713: _signal doesn't use multi-phase init (pythonGH-22087)
  bpo-41700: Skip test if the locale is not supported (pythonGH-22081)
  [doc] Update documentation on logging optimization. (pythonGH-22075)
  Fix 'gather' rules in the python parser generator (pythonGH-22021)
  bpo-41697: Correctly handle KeywordOrStarred when parsing arguments in the parser (pythonGH-22077)
  [doc] Fix a typo in the graphlib docs (python#22030)
  bpo-1635741: Port _signal module to multi-phase init (PEP 489) (pythonGH-22049)
  bpo-39883: Use BSD0 license for code in docs (pythonGH-17635)
  bpo-39010: Improve test shutdown (python#22066)
  bpo-41696: Fix handling of debug mode in asyncio.run (python#22069)
  bpo-41690: Use a loop to collect args in the parser instead of recursion (pythonGH-22053)
  closes bpo-41689: Preserve text signature from tp_doc in C heap type creation. (pythonGH-22058)
  Fix invalid escape sequences in the peg_highlight Sphinx extension (pythonGH-22047)
  bpo-41675: Modernize siginterrupt calls (pythonGH-22028)
  bpo-41685: Don't pin setuptools version anymore in Doc/Makefile (pythonGH-22062)
  ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL