Home | History | Annotate | Download | only in Python

Lines Matching refs:pathname

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

700 if (pathname != NULL) {
701 v = PyString_FromString(pathname);
735 /* Given a pathname for a Python source file, fill a buffer with the
736 pathname for the corresponding compiled file. Return the pathname
741 make_compiled_pathname(char *pathname, char *buf, size_t buflen)
743 size_t len = strlen(pathname);
750 if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0)
753 memcpy(buf, pathname, len);
761 /* Given a pathname for a Python source file, its time of last
762 modification, and a pathname for a compiled file, check whether the
769 check_compiled_module(char *pathname, time_t mtime, char *cpathname)
793 PySys_WriteStderr("# %s matches %s\n", cpathname, pathname);
850 parse_source_module(const char *pathname, FILE *fp)
861 mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, &flags,
864 co = PyAST_Compile(mod, pathname, NULL, arena);
980 update_compiled_module(PyCodeObject *co, char *pathname)
984 if (strcmp(PyString_AsString(co->co_filename), pathname) == 0)
987 newname = PyString_FromString(pathname);
1007 win32_mtime(FILE *fp, char *pathname)
1018 pathname);
1036 load_source_module(char *name, char *pathname, FILE *fp)
1049 pathname);
1054 mtime = win32_mtime(fp, pathname);
1072 cpathname = make_compiled_pathname(pathname, buf,
1075 (fpc = check_compiled_module(pathname, mtime, cpathname))) {
1080 if (update_compiled_module(co, pathname) < 0)
1085 pathname = cpathname;
1088 co = parse_source_module(pathname, fp);
1093 name, pathname);
1103 m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname);
1126 load_package(char *name, char *pathname)
1141 name, pathname);
1143 file = PyString_FromString(pathname);
1284 pathname and an open file. Return NULL if the module is not found. */
1889 load_module(char *name, FILE *fp, char *pathname, int type, PyObject *loader)
1910 m = load_source_module(name, pathname, fp);
1914 m = load_compiled_module(name, pathname, fp);
1919 m = _PyImport_LoadDynamicModule(name, pathname, fp);
1924 m = load_package(name, pathname);
1929 if (pathname != NULL && pathname[0] != '\0')
1930 name = pathname;
2951 char *pathname;
2954 pathname = PyMem_MALLOC(MAXPATHLEN+1);
2955 if (pathname == NULL) {
2958 pathname[0] = '\0';
2961 fdp = find_module(NULL, name, path, pathname, MAXPATHLEN+1, &fp, NULL);
2963 PyMem_FREE(pathname);
2967 fob = PyFile_FromFile(fp, pathname, fdp->mode, fclose);
2969 PyMem_FREE(pathname);
2978 fob, pathname, fdp->suffix, fdp->mode, fdp->type);
2980 PyMem_FREE(pathname);
3065 get_file(char *pathname, PyObject *fob, char *mode)
3071 fp = fopen(pathname, mode);
3088 char *pathname;
3092 if (!PyArg_ParseTuple(args, "ss|O!:load_compiled", &name, &pathname,
3095 fp = get_file(pathname, fob, "rb");
3098 m = load_compiled_module(name, pathname, fp);
3110 char *pathname;
3114 if (!PyArg_ParseTuple(args, "ss|O!:load_dynamic", &name, &pathname,
3118 fp = get_file(pathname, fob, "r");
3122 m = _PyImport_LoadDynamicModule(name, pathname, fp);
3132 char *pathname;
3136 if (!PyArg_ParseTuple(args, "ss|O!:load_source", &name, &pathname,
3139 fp = get_file(pathname, fob, "r");
3142 m = load_source_module(name, pathname, fp);
3153 char *pathname;
3160 &name, &fob, &pathname,
3182 fp = get_file(pathname, fob, mode);
3186 return load_module(name, fp, pathname, type, NULL);
3193 char *pathname;
3194 if (!PyArg_ParseTuple(args, "ss:load_package", &name, &pathname))
3196 return load_package(name, pathname);
3325 PyErr_SetString(PyExc_ImportError, "empty pathname");