Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 import os, sys, subprocess
3 def writetofile(args):
4 with open(args[0], 'w') as f:
5 f.write(' '.join(args[1:]))
7 def writeenvtofile(args):
8 with open(args[0], 'w') as f:
9 f.write(os.environ[args[1]])
11 def writesubprocessenvtofile(args):
12 with open(args[0], 'w') as f:
13 p = subprocess.Popen([sys.executable, "-c",
14 "import os; print os.environ['%s']" % args[1]],
15 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
16 stdout, stderr = p.communicate()
17 assert p.returncode == 0
18 f.write(stdout)
20 def convertasplode(arg):
21 try:
22 return int(arg)
23 except:
24 return (None if arg == "None" else arg)
26 def asplode(args):
27 arg0 = convertasplode(args[0])
28 sys.exit(arg0)
30 def asplode_return(args):
31 arg0 = convertasplode(args[0])
32 return arg0
34 def asplode_raise(args):
35 raise Exception(args[0])
37 def delayloadfn(args):
38 import delayload