Fix handling of memory limit command line argument

If a string of only numerals is passed as argument we assume it should
be converted to an integer and specifies a size in bytes.
pull/652/head
Tim Head 2019-04-27 10:49:32 +02:00
rodzic eb551eb248
commit 24eb3f923a
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -299,7 +299,12 @@ def make_r2d(argv=None):
r2d.user_name = args.user_name
if args.build_memory_limit:
r2d.build_memory_limit = args.build_memory_limit
# if the string only contains numerals we assume it should be an int
# and specifies a size inn bytes
if args.build_memory_limit.isnumeric():
r2d.build_memory_limit = int(args.build_memory_limit)
else:
r2d.build_memory_limit = args.build_memory_limit
if args.environment and not r2d.run:
print('To specify environment variables, you also need to run '