Isn't this equivalent to calling `os.path.dirname(ipdir)`?