File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,13 @@ def set(key, value):
393
393
targets [target ][0 ] = targets [target ][0 ].replace ("x86_64-unknown-linux-gnu" , target )
394
394
395
395
396
+ def is_number (value ):
397
+ try :
398
+ float (value )
399
+ return True
400
+ except :
401
+ return False
402
+
396
403
# Here we walk through the constructed configuration we have from the parsed
397
404
# command line arguments. We then apply each piece of configuration by
398
405
# basically just doing a `sed` to change the various configuration line to what
@@ -406,7 +413,11 @@ def to_toml(value):
406
413
elif isinstance (value , list ):
407
414
return '[' + ', ' .join (map (to_toml , value )) + ']'
408
415
elif isinstance (value , str ):
409
- return "'" + value + "'"
416
+ # Don't put quotes around numeric values
417
+ if is_number (value ):
418
+ return value
419
+ else :
420
+ return "'" + value + "'"
410
421
else :
411
422
raise RuntimeError ('no toml' )
412
423
You can’t perform that action at this time.
0 commit comments