diff options
author | Larry Hastings <larry@hastings.org> | 2014-01-26 06:01:12 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-01-26 06:01:12 (GMT) |
commit | f0537e8d1c9f070d094425b9bf824756fc9498f8 (patch) | |
tree | 60d2fbde46ef3db39a0843c57344d6969cb8e440 /Modules/clinic | |
parent | 0711dd921bd49c3d88e3716c43f8842bcc70bab4 (diff) | |
download | cpython-f0537e8d1c9f070d094425b9bf824756fc9498f8.zip cpython-f0537e8d1c9f070d094425b9bf824756fc9498f8.tar.gz cpython-f0537e8d1c9f070d094425b9bf824756fc9498f8.tar.bz2 |
Issue #20390: Final fix, for generating NoPositional/NoKeyword for __init__ calls.
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_bz2module.c.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 68250af..1611002 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -75,7 +75,8 @@ _bz2_BZ2Compressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) int return_value = -1; int compresslevel = 9; - if (!_PyArg_NoKeywords("BZ2Compressor", kwargs)) + if ((Py_TYPE(self) == &BZ2Compressor_Type) && + !_PyArg_NoKeywords("BZ2Compressor", kwargs)) goto exit; if (!PyArg_ParseTuple(args, "|i:BZ2Compressor", @@ -137,13 +138,15 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - if (!_PyArg_NoPositional("BZ2Decompressor", args)) + if ((Py_TYPE(self) == &BZ2Decompressor_Type) && + !_PyArg_NoPositional("BZ2Decompressor", args)) goto exit; - if (!_PyArg_NoKeywords("BZ2Decompressor", kwargs)) + if ((Py_TYPE(self) == &BZ2Decompressor_Type) && + !_PyArg_NoKeywords("BZ2Decompressor", kwargs)) goto exit; return_value = _bz2_BZ2Decompressor___init___impl((BZ2Decompressor *)self); exit: return return_value; } -/*[clinic end generated code: checksum=9bb33ae7d35494b7a5365f03f390e4b5b8b1bc49]*/ +/*[clinic end generated code: checksum=4ade1dba3921a8bd8a614e5417f7654d8fb10be5]*/ |