'change directory to self and return old current directory'

def chdir(self):

    try:
        old = self.__class__()
    except py.error.ENOENT:
        old = None
    py.error.checked_call(os.chdir, self.strpath)
    return old
