Title: Argument Clinic: error on __new__ or __init__ with no arguments
Type: behavior Stage:
Components: Build, Demos and Tools Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, taleinat
Priority: normal Keywords: patch

Created on 2014-01-22 16:42 by taleinat, last changed 2014-01-31 13:06 by taleinat. This issue is now closed.

File name Uploaded Description Edit taleinat, 2014-01-22 16:42 Patch fixing AC handling of __new__ and __init__ methods without arguments. review
Messages (3)
msg208826 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-22 16:42
This is caused by the code "fields = list(parser_body_fields)" under
"if new_or_init:" in CLanguage.output_templates().

'parser_body_fields' is initialized to None and may not be set before the
above mentioned code.

Attached is a patch which replaces the line with:

fields = list(parser_body_fields) if parser_body_fields is not None else []
msg209766 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-31 11:11
parser_body_fields is initialized to () these days, which should make this problem go away.  Do you still have the issue in current trunk?

Again, if you'd attached a reproducable test case, I could have independently verified the problem, and that it was fixed.
msg209782 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-31 13:06
This has indeed been fixed by the change you mentioned.
Date User Action Args
2014-01-31 13:06:13taleinatsetstatus: open -> closed
resolution: fixed
messages: + msg209782
2014-01-31 11:11:18larrysetmessages: + msg209766
2014-01-22 16:42:02taleinatcreate