def slash_join(base, extension):
    "Join two strings with a '/', avoiding duplicate slashes\n\n    If any of the strings is None the other is returned as is.\n    "
    if (extension is None):
        return base
    if (base is None):
        return extension
    return '/'.join((base.rstrip('/'), extension.lstrip('/')))
Join two strings with a '/', avoiding duplicate slashes

If any of the strings is None the other is returned as is.
def slash_join(base, extension):
    "Join two strings with a '/', avoiding duplicate slashes\n\n    If any of the strings is None the other is returned as is.\n    "
    if (extension is None):
        return base
    if (base is None):
        return extension
    return '/'.join((base.rstrip('/'), extension.lstrip('/')))