From 5b0443cf3ef5799cd34fc5975b3225ecd07233ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20D=C3=B6rwald?= Date: Tue, 5 Jun 2007 16:19:33 +0000 Subject: Use PyUnicode_FromFormat() directly in zipimporter_repr(). --- Modules/zipimport.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Modules/zipimport.c b/Modules/zipimport.c index fd139f2..b56e6f5 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] */ -- cgit v0.12