mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 03:23:55 +03:00
Fixed lint
This commit is contained in:
parent
b5cc0a81da
commit
1a52cf9a3d
|
@ -9,14 +9,14 @@ def import_string(dotted_path):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
module_path, class_name = dotted_path.rsplit('.', 1)
|
module_path, class_name = dotted_path.rsplit('.', 1)
|
||||||
except ValueError as err:
|
except ValueError:
|
||||||
raise ImportError("%s doesn't look like a module path" % dotted_path)
|
raise ImportError("%s doesn't look like a module path" % dotted_path)
|
||||||
|
|
||||||
module = import_module(module_path)
|
module = import_module(module_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return getattr(module, class_name)
|
return getattr(module, class_name)
|
||||||
except AttributeError as err:
|
except AttributeError:
|
||||||
raise ImportError('Module "%s" does not define a "%s" attribute/class' % (
|
raise ImportError('Module "%s" does not define a "%s" attribute/class' % (
|
||||||
module_path, class_name)
|
module_path, class_name)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user