old_contents: # Copyright (C) 2013 by Alex Brandt <alunduil@alunduil.com>
  #
  # pmort is freely distributable under the terms of an MIT-style license.
  # See COPYING or http://www.opensource.org/licenses/mit-license.php.
  
  # -----------------------------------------------------------------------------
  import sys
  import configparser
  import traceback
  
  original_sections = sys.modules['configparser'].ConfigParser.sections
  
  def monkey_sections(self):
      '''Return a list of sections available; DEFAULT is not included in the list.
  
      Monkey patched to exclude the nosetests section as well.
  
      '''
  
      _ = original_sections(self)
  
      if any([ 'distutils/dist.py' in frame[0] for frame in traceback.extract_stack() ]) and _.count('nosetests'):
          _.remove('nosetests')
  
      return _
  
  sys.modules['configparser'].ConfigParser.sections = monkey_sections
  # -----------------------------------------------------------------------------
  
  from ez_setup import use_setuptools
  use_setuptools()
  
  from setuptools import setup
  
  from parameters import information
  
  PARAMS = {}
  
  PARAMS['name'] = information.NAME
  PARAMS['version'] = information.VERSION
  PARAMS['description'] = information.DESCRIPTION
  PARAMS['long_description'] = information.LONG_DESCRIPTION
  PARAMS['author'] = information.AUTHOR
  PARAMS['author_email'] = information.AUTHOR_EMAIL
  PARAMS['url'] = information.URL
  PARAMS['license'] = information.LICENSE
  
  PARAMS['classifiers'] = [
          'Development Status :: 2 - Pre-Alpha',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Natural Language :: English',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Topic :: Software Development :: Libraries',
          ]
  
  PARAMS['keywords'] = [
          'parameters',
          'configuration',
          'environment',
          'arguments',
          ]
  
  PARAMS['provides'] = [
          'parameters',
          ]
  
  with open('requirements.txt', 'r') as req_fh:
      PARAMS['install_requires'] = req_fh.readlines()
  
  with open('test_parameters/requirements.txt', 'r') as req_fh:
      PARAMS['tests_require'] = req_fh.readlines()
  
  PARAMS['test_suire'] = 'nose.collector'
  
  PARAMS['packages'] = [
          'parameters',
          ]
  
  PARAMS['data_files'] = [
          ('share/doc/{P[name]}-{P[version]}'.format(P = PARAMS), [
              'README.rst',
              ]),
          ]
  
  setup(**PARAMS)
  
new_contents: # Copyright (C) 2013 by Alex Brandt <alunduil@alunduil.com>
  #
  # pmort is freely distributable under the terms of an MIT-style license.
  # See COPYING or http://www.opensource.org/licenses/mit-license.php.
  
  # -----------------------------------------------------------------------------
  import sys
  import traceback
  
  try:
      import configparser
      configparser_name = 'configparser'
  except ImportError:
      import ConfigParser
      configparser_name = 'ConfigParser'
  
  original_sections = sys.modules[configparser_name].ConfigParser.sections
  
  def monkey_sections(self):
      '''Return a list of sections available; DEFAULT is not included in the list.
  
      Monkey patched to exclude the nosetests section as well.
  
      '''
  
      _ = original_sections(self)
  
      if any([ 'distutils/dist.py' in frame[0] for frame in traceback.extract_stack() ]) and _.count('nosetests'):
          _.remove('nosetests')
  
      return _
  
  sys.modules[configparser_name].ConfigParser.sections = monkey_sections
  # -----------------------------------------------------------------------------
  
  from ez_setup import use_setuptools
  use_setuptools()
  
  from setuptools import setup
  
  from parameters import information
  
  PARAMS = {}
  
  PARAMS['name'] = information.NAME
  PARAMS['version'] = information.VERSION
  PARAMS['description'] = information.DESCRIPTION
  PARAMS['long_description'] = information.LONG_DESCRIPTION
  PARAMS['author'] = information.AUTHOR
  PARAMS['author_email'] = information.AUTHOR_EMAIL
  PARAMS['url'] = information.URL
  PARAMS['license'] = information.LICENSE
  
  PARAMS['classifiers'] = [
          'Development Status :: 2 - Pre-Alpha',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Natural Language :: English',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Topic :: Software Development :: Libraries',
          ]
  
  PARAMS['keywords'] = [
          'parameters',
          'configuration',
          'environment',
          'arguments',
          ]
  
  PARAMS['provides'] = [
          'parameters',
          ]
  
  with open('requirements.txt', 'r') as req_fh:
      PARAMS['install_requires'] = req_fh.readlines()
  
  with open('test_parameters/requirements.txt', 'r') as req_fh:
      PARAMS['tests_require'] = req_fh.readlines()
  
  PARAMS['test_suire'] = 'nose.collector'
  
  PARAMS['packages'] = [
          'parameters',
          ]
  
  PARAMS['data_files'] = [
          ('share/doc/{P[name]}-{P[version]}'.format(P = PARAMS), [
              'README.rst',
              ]),
          ]
  
  setup(**PARAMS)
  
subject: Make monkey patch 2 and 3 compliant.