summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-12-29 16:33:45 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-12-29 16:33:45 (GMT)
commitea3fdf44a29accd666a3b5f058539c351d921657 (patch)
treeabf57eaa340195873a649d2d42d50e0dba856064 /Objects/fileobject.c
parentf8bcfb13f126d3990dbccecb48a3d74b11e7841e (diff)
downloadcpython-ea3fdf44a29accd666a3b5f058539c351d921657.zip
cpython-ea3fdf44a29accd666a3b5f058539c351d921657.tar.gz
cpython-ea3fdf44a29accd666a3b5f058539c351d921657.tar.bz2
SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 33fb3bc..fb73385 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -503,7 +503,7 @@ file_truncate(PyFileObject *f, PyObject *args)
if (f->f_fp == NULL)
return err_closed();
newsizeobj = NULL;
- if (!PyArg_ParseTuple(args, "|O:truncate", &newsizeobj))
+ if (!PyArg_UnpackTuple(args, "truncate", 0, 1, &newsizeobj))
return NULL;
/* Set newsize to current postion if newsizeobj NULL, else to the