]> granicus.if.org Git - python/commitdiff
bpo-36362: Avoid unused variables when HAVE_DYNAMIC_LOADING is not defined (GH-12430)
authorStéphane Wirtel <stephane@wirtel.be>
Tue, 19 Mar 2019 23:37:20 +0000 (00:37 +0100)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 19 Mar 2019 23:37:20 +0000 (16:37 -0700)
https://bugs.python.org/issue36362

Python/import.c

index 898321ac3b475bbfec20fbf1a65103d5367e9d8b..bf3a99414fb86096cc196f2eb0083dfe8f60d1af 100644 (file)
@@ -1983,13 +1983,14 @@ _imp_extension_suffixes_impl(PyObject *module)
 /*[clinic end generated code: output=0bf346e25a8f0cd3 input=ecdeeecfcb6f839e]*/
 {
     PyObject *list;
-    const char *suffix;
-    unsigned int index = 0;
 
     list = PyList_New(0);
     if (list == NULL)
         return NULL;
 #ifdef HAVE_DYNAMIC_LOADING
+    const char *suffix;
+    unsigned int index = 0;
+
     while ((suffix = _PyImport_DynLoadFiletab[index])) {
         PyObject *item = PyUnicode_FromString(suffix);
         if (item == NULL) {