Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 0f2b8cb62fdbb349e58fc192810533de > files > 1

scons-0.97-1mdv2008.0.src.rpm

--- scons-0.97.orig/engine/SCons/Tool/qt.py
+++ scons-0.97/engine/SCons/Tool/qt.py
@@ -139,7 +139,10 @@
                 # c or fortran source
                 continue
             #cpp_contents = comment.sub('', cpp.get_contents())
-            cpp_contents = cpp.get_contents()
+            try:
+                cpp_contents = cpp.get_contents()
+            except AttributeError: # non-existant file
+                cpp_contents = None   
             h=None
             for h_ext in header_extensions:
                 # try to find the header file in the corresponding source
@@ -162,7 +165,7 @@
                 #moc_cpp.target_scanner = SCons.Defaults.CScan
                 if debug:
                     print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp))
-            if cpp and q_object_search.search(cpp_contents):
+            if cpp_contents and cpp and q_object_search.search(cpp_contents):
                 # cpp file with Q_OBJECT macro found -> add moc
                 # (to be included in cpp)
                 moc = env.Moc(cpp)