summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2013-05-21 12:43:21 +0200
committerChristian Stenger <christian.stenger@digia.com>2013-05-29 09:16:25 +0200
commitd007681b318d400779ea8a08fb25076dfdf5bd54 (patch)
tree9793570e911a9d33cb7ae76db7777683bf1c14b3 /tests
parent86d7e28db4053d771fba2819d88ffbf5cf0843e5 (diff)
downloadqt-creator-d007681b318d400779ea8a08fb25076dfdf5bd54.tar.gz
Squish: Improve changePermission()
Change-Id: I3ce1691afc2fad3949d216dee37b06a33e40f6f1 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/system/shared/fs_utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/system/shared/fs_utils.py b/tests/system/shared/fs_utils.py
index 5a0c22ea15..8a5c8e3451 100644
--- a/tests/system/shared/fs_utils.py
+++ b/tests/system/shared/fs_utils.py
@@ -50,9 +50,15 @@ def changeFilePermissions(dirPath, readPerm, writePerm, excludeFileNames=None):
return False
filePaths = [os.path.join(dirPath, fileName) for fileName in os.listdir(dirPath)
if fileName not in excludeFileNames]
+ result = True
for filePath in filter(os.path.isfile, filePaths):
- os.chmod(filePath, permission)
- return True
+ try:
+ os.chmod(filePath, permission)
+ except:
+ t,v = sys.exc_info()[:2]
+ test.log("Error: %s(%s)" % (str(t), str(v)))
+ result = False
+ return result
def isWritable(pathToFile):
if os.path.exists(pathToFile):