Make the "path math" more robust, and support both relative and
absolute paths as input.
diff --git a/Doc/tools/py2texi.el b/Doc/tools/py2texi.el
index b117cad..b7155ac 100644
--- a/Doc/tools/py2texi.el
+++ b/Doc/tools/py2texi.el
@@ -569,9 +569,13 @@
 			  (string-match "\\.ind\\.tex$" filename)))
       (setq dirs py2texi-dirs)
       (while (and (not includefile) dirs)
-	(setq includefile (concat path (car dirs) filename))
+	(setq includefile
+              (concat (file-name-as-directory (car dirs)) filename))
+        (if (not (file-name-absolute-p includefile))
+            (setq includefile
+                  (concat (file-name-as-directory path) includefile)))
 	(unless (file-exists-p includefile)
-	  (setq includefile nil)
+          (setq includefile nil)
 	  (setq dirs (cdr dirs))))
       (if includefile
 	  (save-restriction