]> granicus.if.org Git - python/commitdiff
In 'link_shared_object()', try to be less sensitive to missing input files
authorGreg Ward <gward@python.net>
Tue, 21 Sep 1999 18:36:15 +0000 (18:36 +0000)
committerGreg Ward <gward@python.net>
Tue, 21 Sep 1999 18:36:15 +0000 (18:36 +0000)
in dry-run mode.

Lib/distutils/unixccompiler.py

index 01493131108a402a7d3f5028b1dcdb701bc8c0ff..02fbc66aa7e0bb5a67fe50fb77276216d312eb91 100644 (file)
@@ -202,7 +202,17 @@ class UnixCCompiler (CCompiler):
         # If any of the input object files are newer than the output shared
         # object, relink.  Again, this is a simplistic dependency check:
         # doesn't look at any of the libraries we might be linking with.
-        if newer_group (objects, output_filename):
+        # Note that we have to dance around errors comparing timestamps if
+        # we're in dry-run mode (yuck).
+        try:
+            newer = newer_group (objects, output_filename)
+        except OSError:
+            if self.dry_run:
+                newer = 1
+            else:
+                raise
+
+        if newer:
             ld_args = self.ldflags_shared + lib_opts + \
                       objects + ['-o', output_filename]