diff --git a/korman/exporter/python.py b/korman/exporter/python.py index ef87718..e397d95 100644 --- a/korman/exporter/python.py +++ b/korman/exporter/python.py @@ -149,9 +149,12 @@ class PythonPackageExporter: # DONE report.progress_end() + report.raise_errors() def _package_python(self, report): py_code = self._compyle(report) + if not py_code: + report.error("No Python files were packaged.") self._write_python_pak(py_code, report) def _write_python_pak(self, py_code, report): diff --git a/korman/korlib/python.py b/korman/korlib/python.py index f2033a9..5869539 100644 --- a/korman/korlib/python.py +++ b/korman/korlib/python.py @@ -132,7 +132,9 @@ def package_python(stream, pyc_objects): # ~~~~~ # uint32_t filesz # uint8_t data[filesz] - assert bool(pyc_objects) + if not pyc_objects: + stream.writeInt(0) + return # `stream` might be a plEncryptedStream, which doesn't seek very well at all. # Therefore, we will go ahead and calculate the size of the index block so diff --git a/korman/operators/op_export.py b/korman/operators/op_export.py index b83ea5c..e4df68e 100644 --- a/korman/operators/op_export.py +++ b/korman/operators/op_export.py @@ -277,6 +277,9 @@ class PlasmaPythonExportOperator(ExportOperator, bpy.types.Operator): except korlib.PythonNotAvailableError as error: self.report({"ERROR"}, "Python Version {} not found".format(error)) return {"CANCELLED"} + except exporter.NonfatalExportError as error: + self.report({"WARNING"}, str(error)) + return {"FINISHED"} else: return {"FINISHED"}