diff Python/compile.c @ 2241:fefae37c053c legacy-trunk

added missing case to get_docstring
author Guido van Rossum <guido@python.org>
date Thu, 26 Jan 1995 00:40:09 +0000
parents cdb373f65bf3
children 07913fb8f92f
line wrap: on
line diff
--- a/Python/compile.c	Thu Jan 26 00:39:50 1995 +0000
+++ b/Python/compile.c	Thu Jan 26 00:40:09 1995 +0000
@@ -483,7 +483,6 @@
 	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 @@
 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 @@
 		}
 		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: