mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
added missing case to get_docstring
This commit is contained in:
parent
a6f6050229
commit
164d4ff0e5
1 changed files with 10 additions and 2 deletions
|
@ -483,7 +483,6 @@ com_addopname(c, op, n)
|
||||||
int op;
|
int op;
|
||||||
node *n;
|
node *n;
|
||||||
{
|
{
|
||||||
object *v;
|
|
||||||
char *name;
|
char *name;
|
||||||
char buffer[1000];
|
char buffer[1000];
|
||||||
/* XXX it is possible to write this code without the 1000
|
/* XXX it is possible to write this code without the 1000
|
||||||
|
@ -1868,13 +1867,14 @@ static object *
|
||||||
get_docstring(n)
|
get_docstring(n)
|
||||||
node *n;
|
node *n;
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
switch (TYPE(n)) {
|
switch (TYPE(n)) {
|
||||||
|
|
||||||
case suite:
|
case suite:
|
||||||
if (NCH(n) == 1)
|
if (NCH(n) == 1)
|
||||||
return get_docstring(CHILD(n, 0));
|
return get_docstring(CHILD(n, 0));
|
||||||
else {
|
else {
|
||||||
int i;
|
|
||||||
for (i = 0; i < NCH(n); i++) {
|
for (i = 0; i < NCH(n); i++) {
|
||||||
node *ch = CHILD(n, i);
|
node *ch = CHILD(n, i);
|
||||||
if (TYPE(ch) == stmt)
|
if (TYPE(ch) == stmt)
|
||||||
|
@ -1883,6 +1883,14 @@ get_docstring(n)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case file_input:
|
||||||
|
for (i = 0; i < NCH(n); i++) {
|
||||||
|
node *ch = CHILD(n, i);
|
||||||
|
if (TYPE(ch) == stmt)
|
||||||
|
return get_docstring(ch);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case stmt:
|
case stmt:
|
||||||
case simple_stmt:
|
case simple_stmt:
|
||||||
case small_stmt:
|
case small_stmt:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue