Skip to content

Commit 00e107f

Browse files
authored
Simplify get_subresource_location. NFC (#21260)
This function only ever gets called with no arguments. I also confirmed that when we use a memory init file, that file always exists.
1 parent 1e79d01 commit 00e107f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tools/link.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,13 +2829,8 @@ def move_file(src, dst):
28292829

28302830

28312831
# Returns the subresource location for run-time access
2832-
def get_subresource_location(path, data_uri=None):
2833-
if data_uri is None:
2834-
data_uri = settings.SINGLE_FILE
2835-
if data_uri:
2836-
# if the path does not exist, then there is no data to encode
2837-
if not os.path.exists(path):
2838-
return ''
2832+
def get_subresource_location(path):
2833+
if settings.SINGLE_FILE:
28392834
data = base64.b64encode(utils.read_binary(path))
28402835
return 'data:application/octet-stream;base64,' + data.decode('ascii')
28412836
else:

0 commit comments

Comments
 (0)