--- pycompile.orig	2010-12-27 11:15:22.000000000 +0100
+++ pycompile	2010-12-27 11:30:03.000000000 +0100
@@ -193,7 +193,16 @@
     for fn, versions_to_compile in filter_files(files, e_patterns, versions):
         cfn = fn + 'c' if (__debug__ or not optimize) else 'o'
         if exists(cfn) and not force:
-            ftime = os.stat(fn).st_mtime
+            try:
+                ftime = os.stat(fn).st_mtime
+            except OSError:
+                try:
+                    os.stat(os.readlink(fn))
+                    sys.exit(1)
+                except OSError:
+                    print fn, " is a dangling symlink"
+                    continue
+                    
             try:
                 ctime = os.stat(cfn).st_mtime
             except os.error:
