Skip to content
Snippets Groups Projects
Unverified Commit c87adc66 authored by Mashiro's avatar Mashiro Committed by GitHub
Browse files

Fix BaseGlobalAssible in Python 3.7 (#76)

Fix CI
parent 149248ce
No related branches found
No related tags found
No related merge requests found
# Copyright (c) OpenMMLab. All rights reserved.
import inspect
from collections import OrderedDict
from typing import Any, Optional
......@@ -28,14 +29,14 @@ class MetaGlobalAccessible(type):
"""
def __init__(cls, *args):
cls._instance_dict = dict()
cls._instance_dict = OrderedDict()
params = inspect.getfullargspec(cls)
# Make sure `cls('root')` can be implemented.
assert 'name' in params[0], \
f'The arguments of the {cls}.__init__ must contain name argument'
assert len(params[3]) == len(params[0]) - 1, \
f'The arguments of the {cls}.__init__ must have default values'
cls.root = cls('root')
cls.root = cls(name='root')
super().__init__(*args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment