From: Walter Dörwald Date: Tue, 5 Jun 2007 16:19:33 +0000 (+0000) Subject: Use PyUnicode_FromFormat() directly in X-Git-Tag: v3.0a1~833 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b0443cf3ef5799cd34fc5975b3225ecd07233ef;p=python Use PyUnicode_FromFormat() directly in zipimporter_repr(). --- diff --git a/Modules/zipimport.c b/Modules/zipimport.c index fd139f250c..b56e6f5a1e 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -187,7 +187,6 @@ zipimporter_dealloc(ZipImporter *self) static PyObject * zipimporter_repr(ZipImporter *self) { - char buf[500]; char *archive = "???"; char *prefix = ""; @@ -196,14 +195,11 @@ zipimporter_repr(ZipImporter *self) if (self->prefix != NULL && PyString_Check(self->prefix)) prefix = PyString_AsString(self->prefix); if (prefix != NULL && *prefix) - PyOS_snprintf(buf, sizeof(buf), - "", - archive, SEP, prefix); + return PyUnicode_FromFormat("", + archive, SEP, prefix); else - PyOS_snprintf(buf, sizeof(buf), - "", - archive); - return PyUnicode_FromString(buf); + return PyUnicode_FromFormat("", + archive); } /* return fullname.split(".")[-1] */