Skip to content

Commit c3cb654

Browse files
author
Sakari Rautiainen
authored
Merge pull request #79 from bitbar/devel
v2.41.3
2 parents 2fc7d84 + 44b2d97 commit c3cb654

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2.41.3
2+
* Isolate Pillow import, with fallback if import fails
13
2.41.2
24
* Add api to abort a test run
35
2.41.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys, os
44

55

6-
version = '2.41.2'
6+
version = '2.41.3'
77

88
setup(name='testdroid',
99
version=version,

testdroid/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
import os, sys, requests, json, logging, time, httplib, base64
4-
from PIL import Image
54
from optparse import OptionParser
65
from datetime import datetime
76

8-
__version__ = '2.41.2'
7+
__version__ = '2.41.3'
98

109
FORMAT = "%(message)s"
1110
logging.basicConfig(format=FORMAT)
@@ -633,9 +632,15 @@ def download_test_screenshots(self, project_id, test_run_id):
633632
''' Earlier downloaded images are checked, and if needed re-downloaded.
634633
'''
635634
try:
635+
from PIL import Image
636636
im=Image.open(full_path)
637637
im.verify()
638638
logger.info("Screenshot %s already exists - skipping download" % full_path)
639+
except ImportError:
640+
if os.path.isfile(full_path): # fallback if Pillow fails to import
641+
logger.info("Screenshot %s already exists - skipping download" % full_path)
642+
else:
643+
raise # jump to next block
639644
except:
640645
url = "me/projects/%s/runs/%s/device-runs/%s/screenshots/%s" % (project_id, test_run['id'], device_run['id'], screenshot['id'])
641646
prog = DownloadProgressBar()

0 commit comments

Comments
 (0)