Commits

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/model.py

 file_type = unknown_type('FILE', '_IO_FILE')
 
 def global_cache(srctype, ffi, funcname, *args):
+    key = (funcname, args)
     try:
-        return ffi._backend.__typecache[args]
+        return ffi._backend.__typecache[key]
     except KeyError:
         pass
     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):