mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
zipimport: fix indentation
This commit is contained in:
parent
f038b32d0b
commit
c342fca222
1 changed files with 5 additions and 4 deletions
|
|
@ -41,6 +41,7 @@ struct _zipimporter {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *ZipImportError;
|
static PyObject *ZipImportError;
|
||||||
|
/* read_directory() cache */
|
||||||
static PyObject *zip_directory_cache = NULL;
|
static PyObject *zip_directory_cache = NULL;
|
||||||
|
|
||||||
/* forward decls */
|
/* forward decls */
|
||||||
|
|
@ -369,13 +370,13 @@ zipimporter_get_filename(PyObject *obj, PyObject *args)
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename",
|
if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename",
|
||||||
&fullname))
|
&fullname))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Deciding the filename requires working out where the code
|
/* Deciding the filename requires working out where the code
|
||||||
would come from if the module was actually loaded */
|
would come from if the module was actually loaded */
|
||||||
code = get_module_code(self, fullname, &ispackage, &modpath);
|
code = get_module_code(self, fullname, &ispackage, &modpath);
|
||||||
if (code == NULL)
|
if (code == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_DECREF(code); /* Only need the path info */
|
Py_DECREF(code); /* Only need the path info */
|
||||||
|
|
||||||
return PyUnicode_FromString(modpath);
|
return PyUnicode_FromString(modpath);
|
||||||
|
|
@ -677,7 +678,7 @@ get_long(unsigned char *buf) {
|
||||||
|
|
||||||
A toc_entry is a tuple:
|
A toc_entry is a tuple:
|
||||||
|
|
||||||
(__file__, # value to use for __file__, available for all files
|
(__file__, # value to use for __file__, available for all files
|
||||||
compress, # compression kind; 0 for uncompressed
|
compress, # compression kind; 0 for uncompressed
|
||||||
data_size, # size of compressed data on disk
|
data_size, # size of compressed data on disk
|
||||||
file_size, # size of decompressed data
|
file_size, # size of decompressed data
|
||||||
|
|
@ -685,7 +686,7 @@ get_long(unsigned char *buf) {
|
||||||
time, # mod time of file (in dos format)
|
time, # mod time of file (in dos format)
|
||||||
date, # mod data of file (in dos format)
|
date, # mod data of file (in dos format)
|
||||||
crc, # crc checksum of the data
|
crc, # crc checksum of the data
|
||||||
)
|
)
|
||||||
|
|
||||||
Directories can be recognized by the trailing SEP in the name,
|
Directories can be recognized by the trailing SEP in the name,
|
||||||
data_size and file_offset are 0.
|
data_size and file_offset are 0.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue