Practical Maya Programming with Python, Chapter 2 Bug

I am reading Rob’s great book Practical Maya Programming with Python and it is a perfect introduction to PyMEL for me. But, it was written a couple years ago and I guess some things have changed in the newer versions of PyMEL. In chapter two there is a function called convert_to_skeleton that creates a joint and then calls itself on the node’s childeren. In Maya 2016 and PyMEL 1.0.7 this returns child transforms but also any shape nodes under the transform. I fixed it by adding type=‘transform’ to the getChildren call.

def convert_to_skeleton(
        rootnode,
        prefix='skel_',
        joint_size=1.0,
        lcol=BLUE,
        rcol=GREEN,
        ccol=YELLOW,
        _parent=None):
    """Converts a hierarchy of nodes into joints that have the same transform, with their name prefixed with 'prefix'.
    Return the newly created root node. The new hierarch will share the same parent as rootnode.

    :param rootnode: The root PyNode.
     Everything under it will be converted.
    :param prefix: String to prefix newly created nodes with.
    """
    if _parent is None:
        _parent = rootnode.getParent()
    j = _convert_to_joint(
        rootnode, _parent, prefix, joint_size, lcol, rcol, ccol)
    for c in rootnode.getChildren(type='transform'):
        convert_to_skeleton(
            c, prefix, joint_size, lcol, rcol, ccol, j)
    return j