summaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/builder/build.py')
-rw-r--r--src/hydrilla/builder/build.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py
index feecdfe..8354331 100644
--- a/src/hydrilla/builder/build.py
+++ b/src/hydrilla/builder/build.py
@@ -212,10 +212,11 @@ class Build:
file_ref = self.files_by_path.get(desired_path)
if file_ref is None:
- with open(path, 'rb') as file_handle:
- contents = file_handle.read()
+ if not path.is_file():
+ msg = _('referenced_file_{}_missing').format(desired_path)
+ raise FileReferenceError(msg)
- file_ref = FileRef(desired_path, contents)
+ file_ref = FileRef(desired_path, path.read_bytes())
self.files_by_path[desired_path] = file_ref
if include_in_distribution: