Skip to content
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
14 changes: 8 additions & 6 deletions lib/inputstreamhelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,14 @@ def _inputstream_version(self):

@staticmethod
def _get_lib_version(path):
if path:
import re
with open(path, 'rb') as library:
match = re.search(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', str(library.read()))
return match.group(0).lstrip('0')
return '(Not found)'
if not path:
return '(Not found)'
import re
with open(path, 'rb') as library:
match = re.search(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', str(library.read()))
if not match:
return '(Undetected)'
return match.group(0).lstrip('0')

def _chromeos_offset(self, bin_path):
"""Calculate the Chrome OS losetup start offset using fdisk/parted."""
Expand Down