]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
define_module(): Check the module type for validity before using.
authorFred Drake <fdrake@acm.org>
Mon, 17 May 1999 15:00:32 +0000 (15:00 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 17 May 1999 15:00:32 +0000 (15:00 +0000)
  This reflects the changes made in
  ../texinputs/python.sty.

Doc/perl/python.perl

index 12c7d0a1a7dd091706a946e2beab56a20ea60de8..307944e5c5699c2187dfbca00f47d5925c68f06a 100644 (file)
@@ -493,6 +493,12 @@ $THIS_CLASS = '';
 sub define_module{
     my($word,$name) = @_;
     my $section_tag = join('', @curr_sec_id);
+    if ($word ne "built-in" && $word ne "extension"
+       && $word ne "standard" && $word ne "") {
+       write_warnings("Bad module type '$word'"
+                      . " for \\declaremodule (module $name)");
+       $word = "";
+    }
     $word = "$word " if $word;
     $THIS_MODULE = "$name";
     $INDEX_SUBITEM = "(in $name)";