Browse Source

dist: Gracefully skip accidentally included Python .egg archives

rdb 2 weeks ago
parent
commit
c32d5146b3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      direct/src/dist/commands.py

+ 4 - 0
direct/src/dist/commands.py

@@ -79,6 +79,10 @@ def _model_to_bam(_build_cmd, srcpath, dstpath):
 
     _register_python_loaders()
 
+    if src_fn.get_extension() == 'egg' and zipfile.is_zipfile(src_fn.to_os_specific()):
+        _build_cmd.warn('Skipping %s as it appears to be a Python .egg archive, was this included by mistake?' % (src_fn.to_os_specific()))
+        return
+
     loader = p3d.Loader.get_global_ptr()
     options = p3d.LoaderOptions(p3d.LoaderOptions.LF_report_errors |
                                 p3d.LoaderOptions.LF_no_ram_cache)