tests/test_config.py
def chdir(dirname=None):
    """
    This context manager restores the value of the current working directory
    (cwd) after the enclosed code block completes or raises an exception.  If a
    directory name is supplied to the context manager then the cwd is changed
    prior to running the code block.

    Shamelessly lifted from
    http://www.astropython.org/snippet/2009/10/chdir-context-manager
    """
    curdir = os.getcwd()
    try:
        if dirname is not None:
            os.chdir(dirname)
        yield
    finally:
        os.chdir(curdir)

    This context manager restores the value of the current working directory
    (cwd) after the enclosed code block completes or raises an exception.  If a
    directory name is supplied to the context manager then the cwd is changed
    prior to running the code block.

    Shamelessly lifted from
    http://www.astropython.org/snippet/2009/10/chdir-context-manager
    
This context manager restores the value of the current working directory
(cwd) after the enclosed code block completes or raises an exception.  If a
directory name is supplied to the context manager then the cwd is changed
prior to running the code block.


This context manager restores the value of the current working directory ( cwd ) after the enclosed code block completes or raises an exception . If a directory name is supplied to the context manager then the cwd is changed prior to running the code block .
def chdir(dirname=None):
    curdir = os.getcwd()
    try:
        if dirname is not None:
            os.chdir(dirname)
        yield
    finally:
        os.chdir(curdir)
def chdir ( dirname = None ) : curdir = os . getcwd ( ) try : if dirname is not None : os . chdir ( dirname ) yield finally : os . chdir ( curdir )
This context manager restores the value of the current working directory
(cwd) after the enclosed code block completes or raises an exception.
This context manager restores the value of the current working directory ( cwd ) after the enclosed code block completes or raises an exception .
"""
    This context manager restores the value of the current working directory
    (cwd) after the enclosed code block completes or raises an exception.  If a
    directory name is supplied to the context manager then the cwd is changed
    prior to running the code block.

    Shamelessly lifted from
    http://www.astropython.org/snippet/2009/10/chdir-context-manager
    """
dirname