]> granicus.if.org Git - python/commitdiff
\declaremodule: Make this more robust. Only attempt to add an index
authorFred Drake <fdrake@acm.org>
Mon, 17 May 1999 14:47:10 +0000 (14:47 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 17 May 1999 14:47:10 +0000 (14:47 +0000)
 entry based on the module type if the type is known.
 Otherwise, spit out a warning the the module type
 parameter was bad and generate a "plain" index entry.

 Without this, the bad module type was emitted as
 text.

Problem noticed by processing Michael Hudson's docs for
bytecodehacks.

Doc/texinputs/python.sty

index c8d3691f746a38af5842b6e0bf9c7ec32063f2b6..121d045d9580f845a456082525995ff3a050324c 100644 (file)
   \else
     \renewcommand{\py@thismodulekey}{#1}
   \fi
-  \csname py@#2IndexModule\endcsname{#3}
+  \@ifundefined{py@#2IndexModule}{%
+    \typeout{*** MACRO declaremodule called with unknown module type: `#2'}
+    \py@ModuleIndex{#3}%
+  }{%
+    \csname py@#2IndexModule\endcsname{#3}%
+  }
   \label{module-\py@thismodulekey}
 }
 \newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse