Home | History | Annotate | Download | only in Python

Lines Matching refs:pathname

650 PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)

668 if (pathname != NULL) {
669 v = PyString_FromString(pathname);
703 /* Given a pathname for a Python source file, fill a buffer with the
704 pathname for the corresponding compiled file. Return the pathname
709 make_compiled_pathname(char *pathname, char *buf, size_t buflen)
711 size_t len = strlen(pathname);
718 if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0)
721 memcpy(buf, pathname, len);
729 /* Given a pathname for a Python source file, its time of last
730 modification, and a pathname for a compiled file, check whether the
737 check_compiled_module(char *pathname, time_t mtime, char *cpathname)
761 PySys_WriteStderr("# %s matches %s\n", cpathname, pathname);
818 parse_source_module(const char *pathname, FILE *fp)
829 mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, &flags,
832 co = PyAST_Compile(mod, pathname, NULL, arena);
943 update_compiled_module(PyCodeObject *co, char *pathname)
947 if (strcmp(PyString_AsString(co->co_filename), pathname) == 0)
950 newname = PyString_FromString(pathname);
967 load_source_module(char *name, char *pathname, FILE *fp)
979 pathname);
993 cpathname = make_compiled_pathname(pathname, buf,
996 (fpc = check_compiled_module(pathname, st.st_mtime, cpathname))) {
1001 if (update_compiled_module(co, pathname) < 0)
1006 pathname = cpathname;
1009 co = parse_source_module(pathname, fp);
1014 name, pathname);
1021 m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname);
1038 load_package(char *name, char *pathname)
1053 name, pathname);
1055 file = PyString_FromString(pathname);
1189 pathname and an open file. Return NULL if the module is not found. */
1804 load_module(char *name, FILE *fp, char *pathname, int type, PyObject *loader)
1825 m = load_source_module(name, pathname, fp);
1829 m = load_compiled_module(name, pathname, fp);
1834 m = _PyImport_LoadDynamicModule(name, pathname, fp);
1839 m = load_package(name, pathname);
1844 if (pathname != NULL && pathname[0] != '\0')
1845 name = pathname;
2837 char pathname[MAXPATHLEN+1];
2840 pathname[0] = '\0';
2843 fdp = find_module(NULL, name, path, pathname, MAXPATHLEN+1, &fp, NULL);
2847 fob = PyFile_FromFile(fp, pathname, fdp->mode, fclose);
2858 fob, pathname, fdp->suffix, fdp->mode, fdp->type);
2944 get_file(char *pathname, PyObject *fob, char *mode)
2950 fp = fopen(pathname, mode);
2967 char *pathname;
2971 if (!PyArg_ParseTuple(args, "ss|O!:load_compiled", &name, &pathname,
2974 fp = get_file(pathname, fob, "rb");
2977 m = load_compiled_module(name, pathname, fp);
2989 char *pathname;
2993 if (!PyArg_ParseTuple(args, "ss|O!:load_dynamic", &name, &pathname,
2997 fp = get_file(pathname, fob, "r");
3001 m = _PyImport_LoadDynamicModule(name, pathname, fp);
3011 char *pathname;
3015 if (!PyArg_ParseTuple(args, "ss|O!:load_source", &name, &pathname,
3018 fp = get_file(pathname, fob, "r");
3021 m = load_source_module(name, pathname, fp);
3032 char *pathname;
3039 &name, &fob, &pathname,
3061 fp = get_file(pathname, fob, mode);
3065 return load_module(name, fp, pathname, type, NULL);
3072 char *pathname;
3073 if (!PyArg_ParseTuple(args, "ss:load_package", &name, &pathname))
3075 return load_package(name, pathname);
3204 PyErr_SetString(PyExc_ImportError, "empty pathname");