diff options
Diffstat (limited to 'src/hydrilla_builder/build.py')
-rw-r--r-- | src/hydrilla_builder/build.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hydrilla_builder/build.py b/src/hydrilla_builder/build.py index e7c6962..652e537 100644 --- a/src/hydrilla_builder/build.py +++ b/src/hydrilla_builder/build.py @@ -164,12 +164,12 @@ def generate_spdx_report(root): mocked_output = FileBuffer() if reuse_main(args=['--root', str(root), 'lint'], out=mocked_output) != 0: - stderr.write(mocked_out.get_bytes()) + stderr.write(mocked_output.get_bytes().decode()) raise ReuseError('Attempt to generate an SPDX report for a REUSE-incompliant package.') mocked_output = FileBuffer() if reuse_main(args=['--root', str(root), 'spdx'], out=mocked_output) != 0: - stderr.write(mocked_out.get_bytes()) + stderr.write(mocked_output.get_bytes().decode()) raise ReuseError("Couldn't generate an SPDX report for package.") return mocked_output.get_bytes() @@ -249,10 +249,10 @@ class Build: path = path.resolve() if not path.is_relative_to(self.srcdir): - raise FileReferenceException(f"Attempt to load '{filename}' which lies outside package source directory.") + raise FileReferenceError(f"Attempt to load '{filename}' which lies outside package source directory.") - if path == self.index_json_path: - raise FileReferenceException("Attempt to load 'index.json' which is a reserved filename.") + if str(path.relative_to(self.srcdir)) == 'index.json': + raise FileReferenceError("Attempt to load 'index.json' which is a reserved filename.") file_ref = self.files_by_path.get(path) if file_ref is None: |