Update config Error msg (#267)

pull/268/head
Jerry Jiarui XU 2020-05-05 01:04:03 +08:00 committed by GitHub
parent 19e4a06cbc
commit 8441f2310b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -151,9 +151,10 @@ class Config(object):
if isinstance(v, dict) and k in b and not v.pop(DELETE_KEY, False):
if not isinstance(b[k], dict):
raise TypeError(
f'{k}={v} cannot be inherited from base because {k} '
'is a dict in the child config. You may '
f'set `{DELETE_KEY}=True` to ignore the base config')
f'{k}={v} in child config cannot inherit from base '
f'because {k} is a dict in the child config but is of '
f'type {type(b[k])} in base config. You may set '
f'`{DELETE_KEY}=True` to ignore the base config')
b[k] = Config._merge_a_into_b(v, b[k])
else:
b[k] = v