mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
* Add variables and evaluate tests * Add sort order and evaluate tests * Ensure the last output is seen * Add stop on entry tests, normal and abnormal exit tests * Fix tests for 2.7 * Fix minor linting issue
15 lines
420 B
Python
15 lines
420 B
Python
|
|
|
|
class SchemaFileError(Exception):
|
|
"""A schema-file-related operation failed."""
|
|
|
|
|
|
def read_schema(filename, *, _open=open):
|
|
"""Return the data (bytes) in the given schema file."""
|
|
try:
|
|
schemafile = _open(filename, 'rb')
|
|
except FileNotFoundError:
|
|
raise SchemaFileError(
|
|
'schema file {!r} not found'.format(filename))
|
|
with schemafile:
|
|
return schemafile.read()
|