@@ -157,7 +157,10 @@ def log(msg, is_error=False):
157157 sys .stderr .write (msg ) if is_error else sys .stdout .write (msg )
158158
159159def message (msg ):
160- return "[mbed-%s] %s\n " % (os .getpid (), msg )
160+ if very_verbose :
161+ return "[mbed-%s] %s\n " % (os .getpid (), msg )
162+ else :
163+ return "[mbed] %s\n " % msg
161164
162165def info (msg , level = 1 ):
163166 if level <= 0 or verbose :
@@ -1361,7 +1364,7 @@ def cache_lock(self, url):
13611364 if os .path .exists (lock_dir ):
13621365 try :
13631366 if os .path .isfile (lock_file ):
1364- with open (lock_file , 'r' , 0 ) as f :
1367+ with open (lock_file , 'r' ) as f :
13651368 pid = f .read (8 )
13661369 if not pid :
13671370 if int (os .path .getmtime (lock_file )) + timeout < int (time .time ()):
@@ -1382,7 +1385,7 @@ def cache_lock(self, url):
13821385 else :
13831386 try :
13841387 os .mkdir (lock_dir )
1385- with open (lock_file , 'wb' , 0 ) as f :
1388+ with open (lock_file , 'w' ) as f :
13861389 info ("Writing cache lock file %s for pid %s" % (lock_file , os .getpid ()))
13871390 f .write (str (os .getpid ()))
13881391 f .flush ()
@@ -1414,7 +1417,7 @@ def cache_unlock(self, url):
14141417 if os .path .exists (lock_dir ):
14151418 if os .path .isfile (lock_file ):
14161419 try :
1417- with open (lock_file , 'r' , 0 ) as f :
1420+ with open (lock_file , 'r' ) as f :
14181421 pid = f .read (8 )
14191422 if int (pid ) != os .getpid ():
14201423 error ("Cache lock file exists with a different pid (\" %s\" vs \" %s\" )" % (pid , os .getpid ()))
0 commit comments