changeset 11245:d89a5dbaaaf6

ignore sources for which class files do not exist
author Doug Simon <doug.simon@oracle.com>
date Wed, 07 Aug 2013 10:59:10 +0200
parents 3bc0b35218e7
children 2d4df4c43ae2
files mxtool/mx.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Wed Aug 07 02:10:59 2013 +0200
+++ b/mxtool/mx.py	Wed Aug 07 10:59:10 2013 +0200
@@ -348,14 +348,15 @@
                             assert pkg is not None
                             if pkgRoot is None or pkg.startswith(pkgRoot):
                                 pkgOutputDir = join(outputDir, pkg.replace('.', os.path.sep))
-                                for e in os.listdir(pkgOutputDir):
-                                    if includeInnerClasses:
-                                        if e.endswith('.class') and (e.startswith(basename) or e.startswith(basename + '$')):
-                                            className = pkg + '.' + e[:-len('.class')]
-                                            result[className] = source 
-                                    elif e == basename + '.class':
-                                        className = pkg + '.' + basename
-                                        result[className] = source 
+                                if exists(pkgOutputDir):
+                                    for e in os.listdir(pkgOutputDir):
+                                        if includeInnerClasses:
+                                            if e.endswith('.class') and (e.startswith(basename) or e.startswith(basename + '$')):
+                                                className = pkg + '.' + e[:-len('.class')]
+                                                result[className] = source
+                                        elif e == basename + '.class':
+                                            className = pkg + '.' + basename
+                                            result[className] = source
         return result
     
     def _init_packages_and_imports(self):