未验证 提交 1d8c3a7e 编写于 作者: W wangguanzhong 提交者: GitHub

enhance shm utils (#6042)

上级 4952915e
......@@ -34,7 +34,10 @@ SHM_DEFAULT_MOUNT = '/dev/shm'
def _parse_size_in_M(size_str):
num, unit = size_str[:-1], size_str[-1]
if size_str[-1] == 'B':
num, unit = size_str[:-2], size_str[-2]
else:
num, unit = size_str[:-1], size_str[-1]
assert unit in SIZE_UNIT, \
"unknown shm size unit {}".format(unit)
return float(num) * \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册