def grid_configure_query(widget, command, index, option=None):
    """Hack of Tkinter.py Misc method _grid_configure for option queries.

    widget.grid_rowconfigure(1, 'pad') and similar do not work at Python 2.6
    because the self.tk.call(...) for the query, in _grid_configure, returns
    an int (maybe a double for width?) rather than a str; at least when
    Tk/Tcl 8.5 is used.

    This function can handle 'weight', 'pad', 'minsize', 'uniform', and
    'all', option queries for columnconfigure and rowconfigure commands.

    Queries on 'uniform' work in the genuine function.

    """
    if option is None:
        res = widget.tk.call('grid', command, widget._w, index)
        words = widget.tk.splitlist(res)
        dict = {}
        for i in range(0, len(words), 2):
            key = words[i][1:]
            value = words[i + 1]
            if key == 'uniform':
                if not value:
                    value = None
            elif value == '':
                value = None
            dict[key] = value
        return dict
    else:
        res = widget.tk.call(('grid', command, widget._w, index, ''.join((
            '-', option.rstrip('_').lstrip('-')))))
        if option == 'uniform':
            if not res:
                res = None
        elif res == '':
            res = None
        return res
