summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-26 00:40:09 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-26 00:40:09 (GMT)
commit164d4ff0e59f1288566b97d0ffb38d7803cf1493 (patch)
tree4d2d54d139a4a74a8740108b0bd0b345dc3f58cc
parenta6f605022914ff7817ea7003825df32985dcacc3 (diff)
downloadcpython-164d4ff0e59f1288566b97d0ffb38d7803cf1493.zip
cpython-164d4ff0e59f1288566b97d0ffb38d7803cf1493.tar.gz
cpython-164d4ff0e59f1288566b97d0ffb38d7803cf1493.tar.bz2
added missing case to get_docstring
-rw-r--r--Python/compile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 93d5b6d..45bed39 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -483,7 +483,6 @@ com_addopname(c, op, n)
int op;
node *n;
{
- object *v;
char *name;
char buffer[1000];
/* XXX it is possible to write this code without the 1000
@@ -1868,13 +1867,14 @@ static object *
get_docstring(n)
node *n;
{
+ int i;
+
switch (TYPE(n)) {
case suite:
if (NCH(n) == 1)
return get_docstring(CHILD(n, 0));
else {
- int i;
for (i = 0; i < NCH(n); i++) {
node *ch = CHILD(n, i);
if (TYPE(ch) == stmt)
@@ -1883,6 +1883,14 @@ get_docstring(n)
}
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 simple_stmt:
case small_stmt: