mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-23 16:20:49 +00:00
Fix JsonObject type for MyPy
Workaround a MyPy error by marking the driver json Object as of type dict and indexable. Signed-off-by: Archana <archana.madhavan@silabs.com> Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
This commit is contained in:
parent
fdbbcba3eb
commit
a78dc70a50
@ -30,7 +30,9 @@ import jinja2
|
||||
from mbedtls_dev import build_tree
|
||||
|
||||
JSONSchema = NewType('JSONSchema', object)
|
||||
Driver = NewType('Driver', object)
|
||||
# The Driver is an Object, but practically it's indexable and can called a dictionary to
|
||||
# keep MyPy happy till MyPy comes with a more composite type for JsonObjects.
|
||||
Driver = NewType('Driver', dict)
|
||||
|
||||
def render(template_path: str, driver_jsoncontext: list) -> str:
|
||||
"""
|
||||
@ -63,7 +65,6 @@ def validate_json(driverjson_data: Driver, driverschema_list: dict) -> bool:
|
||||
Validate the Driver JSON against an appropriate schema
|
||||
the schema passed could be that matching an opaque/ transparent driver.
|
||||
"""
|
||||
|
||||
driver_type = driverjson_data["type"]
|
||||
driver_prefix = driverjson_data["prefix"]
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user