def get_skincluster(pynode):
    """Returns the pynode's connected skinCluster.
    Returns None if no skinCluster found.

    :param pynode: Any pynode that has a skinCluster connected to it.
    :return: nt.SkinCluster
    """
    try:
        shape_node = pynode.getShape()
    except AttributeError:
        # shape nodes do not have a .getShape() method. So, if we get an attribute error assume pynode is a shape node.
        shape_node = pynode
    if not shape_node:
        return
    skin = shape_node.listHistory(type='skinCluster', future=False)
    try:
        return skin[0]
    except IndexError:
        return None