From 51be26a3fe2e8f966fff8c81f7c7b37b24ebc189 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Fri, 24 Mar 2023 13:22:40 +0100 Subject: [PATCH] yet another windows fix --- src/runtime/python/pypgf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index 98a16a6ac..6ff037e46 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1297,7 +1297,11 @@ GrammarImporter_find_spec(PyTypeObject *class, PyObject *args) (PyUnicode_GET_LENGTH(dir) == 0) ? PyUnicode_FromFormat("%U.pgf", name) : PyUnicode_FromFormat("%U/%U.pgf", dir, name); const char *fpath = PyUnicode_AsUTF8(py_fpath); +#ifdef _WIN32 + if (access(fpath, 0) == 0) { +#else if (access(fpath, F_OK) == 0) { +#endif py_importer = (GrammarImporterObject *)class->tp_alloc(class, 0); py_importer->package_path = get_package_path(dir,name); py_importer->grammar_path = py_fpath;