@@ -157,7 +157,10 @@ def log(msg, is_error=False):
157
157
sys .stderr .write (msg ) if is_error else sys .stdout .write (msg )
158
158
159
159
def 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
161
164
162
165
def info (msg , level = 1 ):
163
166
if level <= 0 or verbose :
@@ -1361,7 +1364,7 @@ def cache_lock(self, url):
1361
1364
if os .path .exists (lock_dir ):
1362
1365
try :
1363
1366
if os .path .isfile (lock_file ):
1364
- with open (lock_file , 'r' , 0 ) as f :
1367
+ with open (lock_file , 'r' ) as f :
1365
1368
pid = f .read (8 )
1366
1369
if not pid :
1367
1370
if int (os .path .getmtime (lock_file )) + timeout < int (time .time ()):
@@ -1382,7 +1385,7 @@ def cache_lock(self, url):
1382
1385
else :
1383
1386
try :
1384
1387
os .mkdir (lock_dir )
1385
- with open (lock_file , 'wb' , 0 ) as f :
1388
+ with open (lock_file , 'w' ) as f :
1386
1389
info ("Writing cache lock file %s for pid %s" % (lock_file , os .getpid ()))
1387
1390
f .write (str (os .getpid ()))
1388
1391
f .flush ()
@@ -1414,7 +1417,7 @@ def cache_unlock(self, url):
1414
1417
if os .path .exists (lock_dir ):
1415
1418
if os .path .isfile (lock_file ):
1416
1419
try :
1417
- with open (lock_file , 'r' , 0 ) as f :
1420
+ with open (lock_file , 'r' ) as f :
1418
1421
pid = f .read (8 )
1419
1422
if int (pid ) != os .getpid ():
1420
1423
error ("Cache lock file exists with a different pid (\" %s\" vs \" %s\" )" % (pid , os .getpid ()))
0 commit comments