summaryrefslogtreecommitdiff
path: root/Programs
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
commit0600ebc4d9a0fbb0f16689fb2c1d6a09482594cc (patch)
tree344429f0f5a016baea2bcd0c5b5952cccdcef942 /Programs
parent881f3319420fd3195c53cc5609808cd6e612837a (diff)
downloadcpython-0600ebc4d9a0fbb0f16689fb2c1d6a09482594cc.tar.gz
Issue #23752: _Py_fstat() is now responsible to raise the Python exception
Add _Py_fstat_noraise() function when a Python exception is not welcome.
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_freeze_importlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c
index 31b3d31bd7..b72fcf486f 100644
--- a/Programs/_freeze_importlib.c
+++ b/Programs/_freeze_importlib.c
@@ -35,7 +35,7 @@ main(int argc, char *argv[])
{
char *inpath, *outpath;
FILE *infile = NULL, *outfile = NULL;
- struct _Py_stat_struct st;
+ struct _Py_stat_struct status;
size_t text_size, data_size, n;
char *text = NULL;
unsigned char *data;
@@ -54,11 +54,11 @@ main(int argc, char *argv[])
fprintf(stderr, "cannot open '%s' for reading\n", inpath);
goto error;
}
- if (_Py_fstat(fileno(infile), &st)) {
+ if (_Py_fstat_noraise(fileno(infile), &status)) {
fprintf(stderr, "cannot fstat '%s'\n", inpath);
goto error;
}
- text_size = st.st_size;
+ text_size = status.st_size;
text = (char *) malloc(text_size + 1);
if (text == NULL) {
fprintf(stderr, "could not allocate %ld bytes\n", (long) text_size);