Revision 98687e91
Added by koszko over 1 year ago
src/hydrilla/builder/build.py | ||
---|---|---|
212 | 212 |
|
213 | 213 |
file_ref = self.files_by_path.get(desired_path) |
214 | 214 |
if file_ref is None: |
215 |
with open(path, 'rb') as file_handle: |
|
216 |
contents = file_handle.read() |
|
215 |
if not path.is_file(): |
|
216 |
msg = _('referenced_file_{}_missing').format(desired_path) |
|
217 |
raise FileReferenceError(msg) |
|
217 | 218 |
|
218 |
file_ref = FileRef(desired_path, contents)
|
|
219 |
file_ref = FileRef(desired_path, path.read_bytes())
|
|
219 | 220 |
self.files_by_path[desired_path] = file_ref |
220 | 221 |
|
221 | 222 |
if include_in_distribution: |
Also available in: Unified diff
raise a more informative error when a file referenced from index.json is missing