import contextlib
import tempfile
import shutil


@contextlib.contextmanager
def temporary_directory():
    """Simple context manager to make a temporary directory"""
    tmpdir = tempfile.mkdtemp()
    yield tmpdir
    shutil.rmtree(tmpdir, ignore_errors=True)


import contextlib
import tempfile
import shutil
import saliweb.test  # for python 2.6 support


@contextlib.contextmanager
def temporary_directory():
    """Simple context manager to make a temporary directory"""
    tmpdir = tempfile.mkdtemp()
    yield tmpdir
    shutil.rmtree(tmpdir, ignore_errors=True)


Add unittest methods to Python 2.6
Add unittest methods to Python 2.6

  import contextlib
  import tempfile
  import shutil
+ import saliweb.test  # for python 2.6 support
  
  
  @contextlib.contextmanager
  def temporary_directory():
      """Simple context manager to make a temporary directory"""
      tmpdir = tempfile.mkdtemp()
      yield tmpdir
      shutil.rmtree(tmpdir, ignore_errors=True)
  
  
Add unittest methods to Python 2.6
## Code Before:
import contextlib
import tempfile
import shutil


@contextlib.contextmanager
def temporary_directory():
    """Simple context manager to make a temporary directory"""
    tmpdir = tempfile.mkdtemp()
    yield tmpdir
    shutil.rmtree(tmpdir, ignore_errors=True)


## Instruction:
Add unittest methods to Python 2.6
## Code After:
import contextlib
import tempfile
import shutil
import saliweb.test  # for python 2.6 support


@contextlib.contextmanager
def temporary_directory():
    """Simple context manager to make a temporary directory"""
    tmpdir = tempfile.mkdtemp()
    yield tmpdir
    shutil.rmtree(tmpdir, ignore_errors=True)

