This commit is contained in:
EFanZh 2024-11-18 18:33:03 +01:00 committed by GitHub
commit 16b2a17240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 6 deletions

View File

@ -400,13 +400,14 @@ class ImageCollection(Collection):
images = []
for chunk in resp:
if 'stream' in chunk:
match = re.search(
r'(^Loaded image ID: |^Loaded image: )(.+)$',
chunk['stream']
images.extend(
match.group(2)
for match in re.finditer(
r'(^Loaded image ID: |^Loaded image: )(.+)$',
chunk['stream'],
re.M
)
)
if match:
image_id = match.group(2)
images.append(image_id)
if 'error' in chunk:
raise ImageLoadError(chunk['error'])