def _RegEnumerator(key, func):
 index = 0
 try:
  while 1:
   (yield func(key, index))
   index += 1
 except WindowsError:
  pass

def _RegEnumerator ( key , func ) : index = 0 try : while 1 : ( yield func ( key , index ) ) index += 1 except WindowsError : pass
enumerates an open registry key as an iterable generator .