[Python-checkins] cpython (2.7): move declaration to top of the function to appease the c89 gods

benjamin.peterson python-checkins at python.org
Mon Sep 5 16:08:16 EDT 2016


https://hg.python.org/cpython/rev/cb2551ecf318
changeset: 103057:cb2551ecf318
branch: 2.7
user: Benjamin Peterson <benjamin at python.org>
date: Mon Sep 05 13:07:48 2016 -0700
summary:
 move declaration to top of the function to appease the c89 gods
files:
 Modules/_hotshot.c | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -340,6 +340,7 @@
 {
 PyObject *key = NULL;
 PyObject *value = NULL;
+ PyObject *list;
 int err;
 
 err = unpack_string(self, &key);
@@ -348,7 +349,7 @@
 err = unpack_string(self, &value);
 if (err)
 goto finally;
- PyObject *list = PyDict_GetItem(self->info, key);
+ list = PyDict_GetItem(self->info, key);
 if (list == NULL) {
 list = PyList_New(0);
 if (list == NULL) {
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /