Commit e22c6d6c authored by Mohamed Mansour's avatar Mohamed Mansour Committed by Commit Bot

mini-installer test cleaning directories bug

This was failing because `stat.S_ISDIR` requires a mode not an
object, the following stack trace happened:

TypeError: unsupported operand type(s) for &: 'nt.stat_result' and 'int'

BUG=1066235

Change-Id: Iac03eef706f684f4bcccba0d22f8fc7a4aa23730
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128459
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754856}
parent 2f7750c7
...@@ -48,7 +48,7 @@ def CleanFile(expectation_name, expectation, variable_expander): ...@@ -48,7 +48,7 @@ def CleanFile(expectation_name, expectation, variable_expander):
'Invalid expectation for CleanFile operation: \'exists\' property for ' + 'Invalid expectation for CleanFile operation: \'exists\' property for ' +
'path %s must not be True' % file_path) 'path %s must not be True' % file_path)
try: try:
if stat.S_ISDIR(os.lstat(file_path)): if stat.S_ISDIR(os.lstat(file_path).st_mode):
shutil.rmtree(file_path) shutil.rmtree(file_path)
logging.info('CleanFile deleted directory %s' % file_path) logging.info('CleanFile deleted directory %s' % file_path)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment