Pārlūkot izejas kodu

fix for non-Windows platforms

[SVN r23834]
Aleksey Gurtovoy 22 gadi atpakaļ
vecāks
revīzija
a2d52b1d4b
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. 10 5
      tools/regression/xsl_reports/utils/checked_system.py

+ 10 - 5
tools/regression/xsl_reports/utils/checked_system.py

@@ -7,12 +7,17 @@ class failure_exception:
         self.rc_ = rc
 
 def system( commands ):
-    f = open( 'tmp.cmd', 'w' )
-    f.write( string.join( commands, '\n' ) )
-    f.close()
-    rc = os.system( 'tmp.cmd' )
-    return rc
+    if sys.platform == 'win32':
+        f = open( 'tmp.cmd', 'w' )
+        f.write( string.join( commands, '\n' ) )
+        f.close()
+        rc = os.system( 'tmp.cmd' )
+        return rc
+    else:
+        rc = os.system( '&&'.join( commands ) )
+        return rc
 
+    
 def checked_system( commands, valid_return_codes = [ 0 ] ):
     rc = system( commands ) 
     if rc not in [ 0 ] + valid_return_codes: raise failure_exception( rc )

粤ICP备19079148号