Good catch Mike. This should be replaced by:

    isinstance(source, basestring)