\py@ModSynopsisFilename:  New macro; gives names of the "current" .syn file.

\chapter:  Extended, ensures that a pending module synopsis is written out
	and then closes the .syn file for the preceeding chapter.
diff --git a/Doc/texinputs/manual.cls b/Doc/texinputs/manual.cls
index 786002d..fe7e3ef 100644
--- a/Doc/texinputs/manual.cls
+++ b/Doc/texinputs/manual.cls
@@ -44,6 +44,15 @@
 %
 \RequirePackage{python}
 
+% support for module synopsis sections:
+\newcommand{\py@ModSynopsisFilename}{\jobname\thechapter.syn}
+\let\py@OldChapter=\chapter
+\renewcommand{\chapter}{
+  \py@ProcessModSynopsis
+  \py@closeModSynopsisFile
+  \py@OldChapter
+}
+
 
 % Change the title page to look a bit better, and fit in with the
 % fncychap ``Bjarne'' style a bit better.