From 62eccff15044a1fe3e13fe9398ccf3aca8878a9b Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Fri, 18 Oct 2019 12:25:04 -0700 Subject: [PATCH] Adding capnp extension validation check - To catch odd import problems on Windows --- capnp/lib/capnp.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capnp/lib/capnp.pyx b/capnp/lib/capnp.pyx index 3c2f490..4a3a974 100644 --- a/capnp/lib/capnp.pyx +++ b/capnp/lib/capnp.pyx @@ -3213,6 +3213,9 @@ cdef class SchemaParser: if not _os.path.isfile(file_name): raise IOError("File not found: " + file_name) + if not file_name.endswith('.capnp'): + raise ValueError("File does not end with .capnp, {}".format(file_name)) + if display_name is None: display_name = _os.path.basename(file_name)