prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  hy raises ImportError out of the box
  This is on Python 2.6.
  
  May be related to #37
  
  I think `hy` should probably install the `importlib` dependency at installation time, or the docs should state clearly that `importlib` needs to be installed ahead of time.  Or, (worst case) state that Python 2.6 is not supported.
  
  ```
  (env)09:52:13 Python (master) >  hy
  Traceback (most recent call last):
    File "/Users/jacobsen/env/bin/hy", line 9, in <module>
      load_entry_point('hy==0.9.10', 'console_scripts', 'hy')()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py", line 343, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py", line 2354, in load_entry_point
      return ep.load()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py", line 2060, in load
      entry = __import__(self.module_name, globals(),globals(), ['__name__'])
    File "/Users/jacobsen/Programming/Python/hy/hy/__init__.py", line 37, in <module>
      import hy.importer  # NOQA
    File "/Users/jacobsen/Programming/Python/hy/hy/importer.py", line 22, in <module>
      from hy.compiler import hy_compile
    File "/Users/jacobsen/Programming/Python/hy/hy/compiler.py", line 44, in <module>
      import importlib
  ImportError: No module named importlib
  (env)09:52:13 Python (master) >  pip install importlib
  Downloading/unpacking importlib
    Downloading importlib-1.0.2.tar.bz2
    Running setup.py egg_info for package importlib
  Installing collected packages: importlib
    Running setup.py install for importlib
  Successfully installed importlib
  Cleaning up...
  (env)09:52:21 Python (master) >  hy
  hy 0.9.10
  => 
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 # Copyright (c) 2012, 2013 Paul Tagliamonte <paultag@debian.org>
  3 #
  4 # Permission is hereby granted, free of charge, to any person obtaining a
  5 # copy of this software and associated documentation files (the "Software"),
  6 # to deal in the Software without restriction, including without limitation
  7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8 # and/or sell copies of the Software, and to permit persons to whom the
  9 # Software is furnished to do so, subject to the following conditions:
  10 #
  11 # The above copyright notice and this permission notice shall be included in
  12 # all copies or substantial portions of the Software.
  13 #
  14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20 # DEALINGS IN THE SOFTWARE.
  21 
  22 import os
  23 import re
  24 import sys
  25 
  26 from setuptools import find_packages, setup
  27 
  28 PKG = "hy"
  29 VERSIONFILE = os.path.join(PKG, "version.py")
  30 verstr = "unknown"
  31 try:
  32     verstrline = open(VERSIONFILE, "rt").read()
  33 except EnvironmentError:
  34     pass  # Okay, there is no version file.
  35 else:
  36     VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
  37     mo = re.search(VSRE, verstrline, re.M)
  38     if mo:
  39         __version__ = mo.group(1)
  40     else:
  41         msg = "if %s.py exists, it is required to be well-formed" % VERSIONFILE
  42         raise RuntimeError(msg)
  43 
  44 long_description = """Hy is a Python <--> Lisp layer. It helps
  45 make things work nicer, and lets Python and the Hy lisp variant play
  46 nice together. """
  47 
  48 install_requires = ['rply>=0.6.2']
  49 if sys.version_info[:2] < (2, 7):
  50     install_requires.append('argparse>=1.2.1')
  51 if os.name == 'nt':
  52     install_requires.append('pyreadline==2.0')
  53 
  54 setup(
  55     name=PKG,
  56     version=__version__,
  57     install_requires=install_requires,
  58     dependency_links=['https://github.com/hylang/rply/zipball/master#egg=rply-0.6.2'],
  59     entry_points={
  60         'console_scripts': [
  61             'hy = hy.cmdline:hy_main',
  62             'hyc = hy.cmdline:hyc_main'
  63         ]
  64     },
  65     packages=find_packages(exclude=['tests*']),
  66     package_data={
  67         'hy.contrib': ['*.hy'],
  68         'hy.core': ['*.hy'],
  69     },
  70     author="Paul Tagliamonte",
  71     author_email="tag@pault.ag",
  72     long_description=long_description,
  73     description='Lisp and Python love each other.',
  74     license="Expat",
  75     url="http://hylang.org/",
  76     platforms=['any'],
  77     classifiers=[
  78         "Development Status :: 4 - Beta",
  79         "Intended Audience :: Developers",
  80         "License :: DFSG approved",
  81         "License :: OSI Approved :: MIT License",  # Really "Expat". Ugh.
  82         "Operating System :: OS Independent",
  83         "Programming Language :: Lisp",
  84         "Programming Language :: Python",
  85         "Programming Language :: Python :: 2",
  86         "Programming Language :: Python :: 2.6",
  87         "Programming Language :: Python :: 2.7",
  88         "Programming Language :: Python :: 3",
  89         "Programming Language :: Python :: 3.2",
  90         "Programming Language :: Python :: 3.3",
  91         "Topic :: Software Development :: Code Generators",
  92         "Topic :: Software Development :: Compilers",
  93         "Topic :: Software Development :: Libraries",
  94     ]
  95 )
  96
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -48,6 +48,7 @@
   install_requires = ['rply>=0.6.2']
   if sys.version_info[:2] < (2, 7):
       install_requires.append('argparse>=1.2.1')
  +    install_requires.append('importlib>=1.0.2')
   if os.name == 'nt':
       install_requires.append('pyreadline==2.0')
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -48,6 +48,7 @@\n install_requires = ['rply>=0.6.2']\n if sys.version_info[:2] < (2, 7):\n     install_requires.append('argparse>=1.2.1')\n+    install_requires.append('importlib>=1.0.2')\n if os.name == 'nt':\n     install_requires.append('pyreadline==2.0')\n", "issue": "hy raises ImportError out of the box\nThis is on Python 2.6.\n\nMay be related to #37\n\nI think `hy` should probably install the `importlib` dependency at installation time, or the docs should state clearly that `importlib` needs to be installed ahead of time.  Or, (worst case) state that Python 2.6 is not supported.\n\n```\n(env)09:52:13 Python (master) >  hy\nTraceback (most recent call last):\n  File \"/Users/jacobsen/env/bin/hy\", line 9, in <module>\n    load_entry_point('hy==0.9.10', 'console_scripts', 'hy')()\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py\", line 343, in load_entry_point\n    return get_distribution(dist).load_entry_point(group, name)\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py\", line 2354, in load_entry_point\n    return ep.load()\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pkg_resources.py\", line 2060, in load\n    entry = __import__(self.module_name, globals(),globals(), ['__name__'])\n  File \"/Users/jacobsen/Programming/Python/hy/hy/__init__.py\", line 37, in <module>\n    import hy.importer  # NOQA\n  File \"/Users/jacobsen/Programming/Python/hy/hy/importer.py\", line 22, in <module>\n    from hy.compiler import hy_compile\n  File \"/Users/jacobsen/Programming/Python/hy/hy/compiler.py\", line 44, in <module>\n    import importlib\nImportError: No module named importlib\n(env)09:52:13 Python (master) >  pip install importlib\nDownloading/unpacking importlib\n  Downloading importlib-1.0.2.tar.bz2\n  Running setup.py egg_info for package importlib\nInstalling collected packages: importlib\n  Running setup.py install for importlib\nSuccessfully installed importlib\nCleaning up...\n(env)09:52:21 Python (master) >  hy\nhy 0.9.10\n=> \n```\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# Copyright (c) 2012, 2013 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n\nimport os\nimport re\nimport sys\n\nfrom setuptools import find_packages, setup\n\nPKG = \"hy\"\nVERSIONFILE = os.path.join(PKG, \"version.py\")\nverstr = \"unknown\"\ntry:\n    verstrline = open(VERSIONFILE, \"rt\").read()\nexcept EnvironmentError:\n    pass  # Okay, there is no version file.\nelse:\n    VSRE = r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\"\n    mo = re.search(VSRE, verstrline, re.M)\n    if mo:\n        __version__ = mo.group(1)\n    else:\n        msg = \"if %s.py exists, it is required to be well-formed\" % VERSIONFILE\n        raise RuntimeError(msg)\n\nlong_description = \"\"\"Hy is a Python <--> Lisp layer. It helps\nmake things work nicer, and lets Python and the Hy lisp variant play\nnice together. \"\"\"\n\ninstall_requires = ['rply>=0.6.2']\nif sys.version_info[:2] < (2, 7):\n    install_requires.append('argparse>=1.2.1')\nif os.name == 'nt':\n    install_requires.append('pyreadline==2.0')\n\nsetup(\n    name=PKG,\n    version=__version__,\n    install_requires=install_requires,\n    dependency_links=['https://github.com/hylang/rply/zipball/master#egg=rply-0.6.2'],\n    entry_points={\n        'console_scripts': [\n            'hy = hy.cmdline:hy_main',\n            'hyc = hy.cmdline:hyc_main'\n        ]\n    },\n    packages=find_packages(exclude=['tests*']),\n    package_data={\n        'hy.contrib': ['*.hy'],\n        'hy.core': ['*.hy'],\n    },\n    author=\"Paul Tagliamonte\",\n    author_email=\"tag@pault.ag\",\n    long_description=long_description,\n    description='Lisp and Python love each other.',\n    license=\"Expat\",\n    url=\"http://hylang.org/\",\n    platforms=['any'],\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"License :: DFSG approved\",\n        \"License :: OSI Approved :: MIT License\",  # Really \"Expat\". Ugh.\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Lisp\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.6\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.2\",\n        \"Programming Language :: Python :: 3.3\",\n        \"Topic :: Software Development :: Code Generators\",\n        \"Topic :: Software Development :: Compilers\",\n        \"Topic :: Software Development :: Libraries\",\n    ]\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# Copyright (c) 2012, 2013 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n\nimport os\nimport re\nimport sys\n\nfrom setuptools import find_packages, setup\n\nPKG = \"hy\"\nVERSIONFILE = os.path.join(PKG, \"version.py\")\nverstr = \"unknown\"\ntry:\n    verstrline = open(VERSIONFILE, \"rt\").read()\nexcept EnvironmentError:\n    pass  # Okay, there is no version file.\nelse:\n    VSRE = r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\"\n    mo = re.search(VSRE, verstrline, re.M)\n    if mo:\n        __version__ = mo.group(1)\n    else:\n        msg = \"if %s.py exists, it is required to be well-formed\" % VERSIONFILE\n        raise RuntimeError(msg)\n\nlong_description = \"\"\"Hy is a Python <--> Lisp layer. It helps\nmake things work nicer, and lets Python and the Hy lisp variant play\nnice together. \"\"\"\n\ninstall_requires = ['rply>=0.6.2']\nif sys.version_info[:2] < (2, 7):\n    install_requires.append('argparse>=1.2.1')\n    install_requires.append('importlib>=1.0.2')\nif os.name == 'nt':\n    install_requires.append('pyreadline==2.0')\n\nsetup(\n    name=PKG,\n    version=__version__,\n    install_requires=install_requires,\n    dependency_links=['https://github.com/hylang/rply/zipball/master#egg=rply-0.6.2'],\n    entry_points={\n        'console_scripts': [\n            'hy = hy.cmdline:hy_main',\n            'hyc = hy.cmdline:hyc_main'\n        ]\n    },\n    packages=find_packages(exclude=['tests*']),\n    package_data={\n        'hy.contrib': ['*.hy'],\n        'hy.core': ['*.hy'],\n    },\n    author=\"Paul Tagliamonte\",\n    author_email=\"tag@pault.ag\",\n    long_description=long_description,\n    description='Lisp and Python love each other.',\n    license=\"Expat\",\n    url=\"http://hylang.org/\",\n    platforms=['any'],\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"License :: DFSG approved\",\n        \"License :: OSI Approved :: MIT License\",  # Really \"Expat\". Ugh.\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Lisp\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.6\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.2\",\n        \"Programming Language :: Python :: 3.3\",\n        \"Topic :: Software Development :: Code Generators\",\n        \"Topic :: Software Development :: Compilers\",\n        \"Topic :: Software Development :: Libraries\",\n    ]\n)\n", "path": "setup.py"}]}