def get_deps(pkg):
    """Get the dependencies for a given apt.Package object.
    Works with the oldest and newest versions of apt_pkg.
    It does not work with version <=0.6.46.
    """
    deps = None
    try:
        """This works with python-apt versions >= 0.7.23"""
        cand = pkg.candidate
    except AttributeError:
        """This works with python-apt versions <= 0.7.14"""
        deps = pkg.candidateDependencies
    else:
        if cand:
            deps = cand.dependencies
    return deps
