diff Objects/moduleobject.c @ 43:ea21982a1532 legacy-trunk

Added getmodulename() public interface.
author Guido van Rossum <guido@python.org>
date Fri, 26 Oct 1990 15:00:11 +0000
parents 32639878d16b
children a6934380c6e7
line wrap: on
line diff
--- a/Objects/moduleobject.c	Fri Oct 26 14:59:30 1990 +0000
+++ b/Objects/moduleobject.c	Fri Oct 26 15:00:11 1990 +0000
@@ -62,6 +62,17 @@
 	return 0;
 }
 
+char *
+getmodulename(m)
+	object *m;
+{
+	if (!is_moduleobject(m)) {
+		err_badarg();
+		return NULL;
+	}
+	return getstringvalue(((moduleobject *)m) -> md_name);
+}
+
 /* Methods */
 
 static void