Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bc8d99

Browse files
committed
\declaremodule: Make this more robust. Only attempt to add an index
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.
1 parent 8ee593c commit 5bc8d99

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/texinputs/python.sty

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@
314314
\else
315315
\renewcommand{\py@thismodulekey}{#1}
316316
\fi
317-
\csname py@#2IndexModule\endcsname{#3}
317+
\@ifundefined{py@#2IndexModule}{%
318+
\typeout{*** MACRO declaremodule called with unknown module type: `#2'}
319+
\py@ModuleIndex{#3}%
320+
}{%
321+
\csname py@#2IndexModule\endcsname{#3}%
322+
}
318323
\label{module-\py@thismodulekey}
319324
}
320325
\newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse

0 commit comments

Comments
 (0)