Skip to content

Commit

Permalink
add try/except block for touch lock
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoTian committed Aug 20, 2016
1 parent 20e6122 commit 5b4991e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions conda/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def touch(file_name, times=None):
Examples:
touch("hello_world.py")
"""
with open(file_name, 'a'):
os.utime(file_name, times)
try:
with open(file_name, 'a'):
os.utime(file_name, times)
except (OSError, IOError) as e:
log.debug(repr(e))


class FileLock(object):
Expand Down

0 comments on commit 5b4991e

Please sign in to comment.