Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify get_subresource_location. NFC #21260

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -2829,13 +2829,8 @@ def move_file(src, dst):


# Returns the subresource location for run-time access
def get_subresource_location(path, data_uri=None):
if data_uri is None:
data_uri = settings.SINGLE_FILE
if data_uri:
# if the path does not exist, then there is no data to encode
if not os.path.exists(path):
return ''
def get_subresource_location(path):
if settings.SINGLE_FILE:
data = base64.b64encode(utils.read_binary(path))
return 'data:application/octet-stream;base64,' + data.decode('ascii')
else:
Expand Down
Loading