Armin Rigo  committed a67eedf

Future-proof fix: the key did not include the funcname. By chance,
the different funcnames have really different arguments.

  • Participants
  • Parent commits bec0477

Comments (0)

Files changed (1)

File cffi/

 file_type = unknown_type('FILE', '_IO_FILE')
 def global_cache(srctype, ffi, funcname, *args):
+    key = (funcname, args)
-        return ffi._backend.__typecache[args]
+        return ffi._backend.__typecache[key]
     except KeyError:
     except AttributeError:
         res = getattr(ffi._backend, funcname)(*args)
     except NotImplementedError as e:
         raise NotImplementedError("%r: %s" % (srctype, e))
-    ffi._backend.__typecache[args] = res
+    ffi._backend.__typecache[key] = res
     return res
 def pointer_cache(ffi, BType):