Key error for kerning dict

When I try to run this script,
I get this error:

Traceback (most recent call last):
  File "Show Kerning", line 44
    for R in Font.kerning[masterID][L]:
  File "", line 18, in __getitem__objectForKey_
    return container_unwrap(res, KeyError, key)
  File "", line 113, in container_unwrap
    raise exc_type(*exc_args)

Ah I realised I needed to add .keys()