--- /Users/jkp/Desktop/bdist_egg.py	2006-10-31 12:20:42.000000000 +0000
+++ /Users/jkp/Desktop/bdist_egg-patched.py	2007-04-20 12:09:37.000000000 +0100
@@ -186,7 +186,17 @@
                 write_stub(os.path.basename(ext_name), pyfile)
             to_compile.append(pyfile)
             ext_outputs[p] = ext_name.replace(os.sep,'/')
-
+        for res in all_outputs:
+            if res.lower().endswith('.pyd'):    # create stubs for .pyd's not compiled by setuptools
+                parts = res.split('/')
+                resource = parts[-1]
+                parts[-1] = strip_module(parts[-1])+'.py'
+                pyfile = os.path.join(self.bdist_dir, *parts)
+                log.info("creating stub loader for %s" % resource)
+                if not self.dry_run:
+                    write_stub(resource, pyfile)
+                to_compile.append(pyfile);
+            
         to_compile.extend(self.make_init_files())
         if to_compile:
             cmd.byte_compile(to_compile)
