@@ -456,6 +456,18 @@ def build_clang_tool_path(tool):
456
456
457
457
# Temp dir. Create a random one, unless EMCC_DEBUG is set, in which case use TEMP_DIR/emscripten_temp
458
458
459
+ def safe_ensure_dirs (dirname ):
460
+ try :
461
+ os .makedirs (dirname )
462
+ except os .error , e :
463
+ # Ignore error for already existing dirname
464
+ if e .errno != errno .EEXIST :
465
+ raise e
466
+ # FIXME: Notice that this will result in a false positive,
467
+ # should the dirname be a file! There seems to no way to
468
+ # handle this atomically in Python 2.x.
469
+ # There is an additional option for Python 3.x, though.
470
+
459
471
class Configuration :
460
472
def __init__ (self , environ = os .environ ):
461
473
self .DEBUG = environ .get ('EMCC_DEBUG' )
@@ -482,7 +494,7 @@ def __init__(self, environ=os.environ):
482
494
self .EMSCRIPTEN_TEMP_DIR = self .CANONICAL_TEMP_DIR
483
495
safe_ensure_dirs (self .EMSCRIPTEN_TEMP_DIR )
484
496
except Exception , e :
485
- logging .debug (str (e ) + 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten' )
497
+ logging .error (str (e ) + 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten' )
486
498
487
499
def get_temp_files (self ):
488
500
return tempfiles .TempFiles (
@@ -1635,17 +1647,5 @@ def unsuffixed(name):
1635
1647
def unsuffixed_basename (name ):
1636
1648
return os .path .basename (unsuffixed (name ))
1637
1649
1638
- def safe_ensure_dirs (dirname ):
1639
- try :
1640
- os .makedirs (dirname )
1641
- except os .error , e :
1642
- # Ignore error for already existing dirname
1643
- if e .errno != errno .EEXIST :
1644
- raise e
1645
- # FIXME: Notice that this will result in a false positive,
1646
- # should the dirname be a file! There seems to no way to
1647
- # handle this atomically in Python 2.x.
1648
- # There is an additional option for Python 3.x, though.
1649
-
1650
1650
import js_optimizer
1651
1651
0 commit comments