nodes: 0, module; 1, function_definition; 2, function_name:_match_version_string; 3, parameters; 4, block; 5, identifier:version; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, comment:# If, for whatever reason, the binary didn't tell us its version, then; 11, comment:# these might be (None, None, None), and so we should avoid typecasting; 12, comment:# them when that is the case.; 13, if_statement; 14, return_statement; 15, comment:"""Sort a binary version string into major, minor, and micro integers.
  
      :param str version: A version string in the form x.x.x
      :raises GnuPGVersionError: if the **version** string couldn't be parsed.
      :rtype: tuple
  
      :returns: A 3-tuple of integers, representing the (MAJOR, MINOR, MICRO)
          version numbers. For example::
  
              _match_version_string("2.1.3")
  
          would return ``(2, 1, 3)``.
      """; 16, assignment; 17, assignment; 18, assignment; 19, boolean_operator; 20, block; 21, else_clause; 22, tuple; 23, identifier:matched; 24, call; 25, identifier:g; 26, call; 27, pattern_list; 28, expression_list; 29, boolean_operator; 30, identifier:micro; 31, expression_statement; 32, block; 33, identifier:major; 34, identifier:minor; 35, identifier:micro; 36, attribute; 37, argument_list; 38, attribute; 39, argument_list; 40, identifier:major; 41, identifier:minor; 42, identifier:micro; 43, subscript; 44, subscript; 45, subscript; 46, identifier:major; 47, identifier:minor; 48, assignment; 49, raise_statement; 50, identifier:_VERSION_STRING_REGEX; 51, identifier:match; 52, identifier:version; 53, identifier:matched; 54, identifier:groups; 55, identifier:g; 56, integer:0; 57, identifier:g; 58, integer:2; 59, identifier:g; 60, integer:4; 61, pattern_list; 62, expression_list; 63, call; 64, identifier:major; 65, identifier:minor; 66, identifier:micro; 67, call; 68, call; 69, call; 70, identifier:GnuPGVersionError; 71, argument_list; 72, identifier:int; 73, argument_list; 74, identifier:int; 75, argument_list; 76, identifier:int; 77, argument_list; 78, binary_operator:"Could not parse GnuPG version from: %r" %
                                  version; 79, identifier:major; 80, identifier:minor; 81, identifier:micro; 82, string:"Could not parse GnuPG version from: %r"; 83, identifier:version
code: def _match_version_string(version):
      """Sort a binary version string into major, minor, and micro integers.
  
      :param str version: A version string in the form x.x.x
      :raises GnuPGVersionError: if the **version** string couldn't be parsed.
      :rtype: tuple
  
      :returns: A 3-tuple of integers, representing the (MAJOR, MINOR, MICRO)
          version numbers. For example::
  
              _match_version_string("2.1.3")
  
          would return ``(2, 1, 3)``.
      """
      matched = _VERSION_STRING_REGEX.match(version)
      g = matched.groups()
      major, minor, micro = g[0], g[2], g[4]
  
      # If, for whatever reason, the binary didn't tell us its version, then
      # these might be (None, None, None), and so we should avoid typecasting
      # them when that is the case.
      if major and minor and micro:
          major, minor, micro = int(major), int(minor), int(micro)
      else:
          raise GnuPGVersionError("Could not parse GnuPG version from: %r" %
                                  version)
  
      return (major, minor, micro)