def pop_dict_last_item(dictionary):
    """
        Until python 3.5 the popitem() has has a bug where it does not accepts the last=False argument
        https://bugs.python.org/issue24394 TypeError: popitem() takes no keyword arguments, then,
        automatically detect which one we have here:
        https://docs.python.org/3/library/collections.html#collections.OrderedDict.popitem
    """
    dictionary.popitem(last=True)
