def GitFile(filename, mode='rb', bufsize=(-1)):
 if ('a' in mode):
  raise IOError('append mode not supported for Git files')
 if ('+' in mode):
  raise IOError('read/write mode not supported for Git files')
 if ('b' not in mode):
  raise IOError('text mode not supported for Git files')
 if ('w' in mode):
  return _GitFile(filename, mode, bufsize)
 else:
  return io.open(filename, mode, bufsize)

def GitFile ( filename , mode = 'rb' , bufsize = ( - 1 ) ) : if ( 'a' in mode ) : raise IOError ( 'append mode not supported for Git files' ) if ( '+' in mode ) : raise IOError ( 'read/write mode not supported for Git files' ) if ( 'b' not in mode ) : raise IOError ( 'text mode not supported for Git files' ) if ( 'w' in mode ) : return _GitFile ( filename , mode , bufsize ) else : return io . open ( filename , mode , bufsize )
create a file object that obeys the git file locking protocol .