Skip to content

Commit 5647355

Browse files
committed
Fix more locations in code that want to split a thing into two based on first equals sign, but ended up splitting to possibly more than two parts. #5467
1 parent 38003e3 commit 5647355

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

tests/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7439,7 +7439,7 @@ def setUp(self):
74397439
Building.COMPILER_TEST_OPTS.append(arg) # so bitcode is optimized too, this is for cpp to ll
74407440
else:
74417441
try:
7442-
key, value = arg.split('=')
7442+
key, value = arg.split('=', 1)
74437443
Settings[key] = value # forward -s K=V
74447444
except:
74457445
pass

tools/asm_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, filename):
5252
for part in imp.split(','):
5353
assert part.count('(') == part.count(')') # we must not break ',' in func(x, y)!
5454
assert part.count('=') == 1
55-
key, value = part.split('=')
55+
key, value = part.split('=', 1)
5656
self.imports[key.strip()] = value.strip()
5757

5858
#print >> sys.stderr, 'imports', self.imports
@@ -266,7 +266,7 @@ def parse_tables(self, js):
266266
for part in parts:
267267
if '=' not in part: continue
268268
part = part.split('var ')[1]
269-
name, data = part.split('=')
269+
name, data = part.split('=', 1)
270270
tables[name.strip()] = data.strip()
271271
return tables
272272

tools/ctor_evaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def add_func(asm, func):
8282
part = part[4:] # skip 'var '
8383
bits = map(lambda x: x.strip(), part.split(','))
8484
for bit in bits:
85-
name, value = map(lambda x: x.strip(), bit.split('='))
85+
name, value = map(lambda x: x.strip(), bit.split('=', 1))
8686
if value in ['0', '+0', '0.0'] or name in [
8787
'STACKTOP', 'STACK_MAX', 'DYNAMICTOP_PTR',
8888
'HEAP8', 'HEAP16', 'HEAP32',

tools/emmaken.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def path_from_root(*pathelems):
191191
if arg == '-o':
192192
found_o = True
193193
continue
194-
prefix = arg.split('=')[0]
194+
prefix = arg.split('=', 1)[0]
195195
if prefix in ALLOWED_LINK_ARGS:
196196
newargs.append(arg)
197197
if arg in TWO_PART_DISALLOWED_LINK_ARGS:

tools/emprofile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
OUTFILE = 'toolchain_profiler.results_' + time.strftime('%Y%m%d_%H%M')
1111
for arg in sys.argv:
1212
if arg.startswith('--outfile='):
13-
OUTFILE = arg.split('=')[1].strip().replace('.html', '')
13+
OUTFILE = arg.split('=', 1)[1].strip().replace('.html', '')
1414

1515
# Deletes all previously captured log files to make room for a new clean run.
1616
def delete_profiler_logs():

tools/emterpretify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
def handle_arg(arg):
3131
global ZERO, ASYNC, ASSERTIONS, PROFILING, FROUND, ADVISE, MEMORY_SAFE, OUTPUT_FILE
3232
if '=' in arg:
33-
l, r = arg.split('=')
33+
l, r = arg.split('=', 1)
3434
if l == 'ZERO': ZERO = int(r)
3535
elif l == 'ASYNC': ASYNC = int(r)
3636
elif l == 'ASSERTIONS': ASSERTIONS = int(r)

tools/file_packager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
use_preload_cache = True
131131
leading = ''
132132
elif arg.startswith('--indexedDB-name'):
133-
indexeddb_name = arg.split('=')[1] if '=' in arg else None
133+
indexeddb_name = arg.split('=', 1)[1] if '=' in arg else None
134134
leading = ''
135135
elif arg == '--no-heap-copy':
136136
no_heap_copy = False
@@ -145,7 +145,7 @@
145145
use_preload_plugins = True
146146
leading = ''
147147
elif arg.startswith('--js-output'):
148-
jsoutput = arg.split('=')[1] if '=' in arg else None
148+
jsoutput = arg.split('=', 1)[1] if '=' in arg else None
149149
leading = ''
150150
elif arg.startswith('--no-closure'):
151151
no_closure = True
@@ -156,10 +156,10 @@
156156
except Exception, e:
157157
print >> sys.stderr, 'could not import CRUNCH (make sure it is defined properly in ' + shared.hint_config_file_location() + ')'
158158
raise e
159-
crunch = arg.split('=')[1] if '=' in arg else '128'
159+
crunch = arg.split('=', 1)[1] if '=' in arg else '128'
160160
leading = ''
161161
elif arg.startswith('--plugin'):
162-
plugin = open(arg.split('=')[1], 'r').read()
162+
plugin = open(arg.split('=', 1)[1], 'r').read()
163163
eval(plugin) # should append itself to plugins
164164
leading = ''
165165
elif leading == 'preload' or leading == 'embed':

tools/js_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def process(line):
371371
minifier = Minifier(js, js_engine)
372372
def check_symbol_mapping(p):
373373
if p.startswith('symbolMap='):
374-
minifier.symbols_file = p.split('=')[1]
374+
minifier.symbols_file = p.split('=', 1)[1]
375375
return False
376376
if p == 'profilingFuncs':
377377
minifier.profiling_funcs = True

tools/system_libs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def retrieve():
569569
# note that tag **must** be the tag in sdl.py, it is where we store to (not where we load from, we just load the local dir)
570570
local_ports = os.environ.get('EMCC_LOCAL_PORTS')
571571
if local_ports:
572-
local_ports = map(lambda pair: pair.split('='), local_ports.split(','))
572+
local_ports = map(lambda pair: pair.split('=', 1), local_ports.split(','))
573573
for local in local_ports:
574574
if name == local[0]:
575575
path, subdir = local[1].split('|')

0 commit comments

Comments
 (0)