def _write_pyc_wrapper(*args):
 try:
  return _orig_write_pyc(*args)
 except IOError as e:
  if (e.errno == errno.EACCES):
   return False

def _write_pyc_wrapper ( * args ) : try : return _orig_write_pyc ( * args ) except IOError as e : if ( e . errno == errno . EACCES ) : return False
wraps the internal _write_pyc method in py .