parameters: (fd)
docstring: Confirm zoneinfo file magic string, and return version number.
docstring_summary: Confirm zoneinfo file magic string, and return version number.
docstring_tokens: Confirm zoneinfo file magic string and return version number .
function: def _get_version(fd):
          """Confirm zoneinfo file magic string, and return version number."""
          if fd.read(4) != b'TZif':
              raise MythTZError(MythTZError.TZ_INVALID_FILE)
          version = fd.read(1) # read version number
          fd.seek(15, 1) # skip reserved bytes
          if version == '\0':
              return 1
          else:
              return int(version)
function_tokens: def _get_version ( fd ) : if fd . read ( 4 ) != b'TZif' : raise MythTZError ( MythTZError . TZ_INVALID_FILE ) version = fd . read ( 1 ) # read version number fd . seek ( 15 , 1 ) # skip reserved bytes if version == '\0' : return 1 else : return int ( version )