Commits

Thomas Waldmann committed 7199e97

use absolute path for root (thanks to Jan Marten Simons for the patch)

Comments (0)

Files changed (1)

generate_modules.py

 """
 
 # Copyright 2008 Société des arts technologiques (SAT), http://www.sat.qc.ca/
-# Copyright 2010 Thomas Waldmann <tw AT waldmann-edv DOT de> 
+# Copyright 2010 Thomas Waldmann <tw AT waldmann-edv DOT de>
 # All rights reserved.
 #
 # This program is free software: you can redistribute it and/or modify
     Look for every file in the directory tree and create the corresponding
     ReST files.
     """
+    # use absolute path for root, as relative paths like '../../foo' cause
+    # 'if "/." in root ...' to filter out *all* modules otherwise
+    path = os.path.abspath(path)
     # check if the base directory is a package and get is name
     if INIT in os.listdir(path):
-        package_name = os.path.abspath(path).split(os.path.sep)[-1]
+        package_name = path.split(os.path.sep)[-1]
     else:
         package_name = None