We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Pip Installing PTVSD fails 
* Python2.7
* Pip install ptvsd from local source fails with the following error:
```
running build_ext
    building 'ptvsd.pydevd._pydevd_bundle.pydevd_cython' extension
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
```

--- 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 
3 # Copyright (c) Microsoft Corporation. All rights reserved.
4 # Licensed under the MIT License. See LICENSE in the project root
5 # for license information.
6 
7 import os
8 import os.path
9 from setuptools import setup, Extension
10 
11 ROOT = os.path.dirname(os.path.abspath(__file__))
12 
13 # Add pydevd files as data files for this package. They are not treated as a package of their own,
14 # because we don't actually want to provide pydevd - just use our own copy internally.
15 def get_pydevd_package_data():
16     ptvsd_prefix = os.path.join(ROOT, 'ptvsd')
17     pydevd_prefix = os.path.join(ptvsd_prefix, 'pydevd')
18     for root, dirs, files in os.walk(pydevd_prefix):
19         # From the root of pydevd repo, we want only scripts and subdirectories that
20         # constitute the package itself (not helper scripts, tests etc). But when
21         # walking down into those subdirectories, we want everything below.
22         if os.path.normcase(root) == os.path.normcase(pydevd_prefix):
23             dirs[:] = [d for d in dirs if d.startswith('pydev') or d.startswith('_pydev')]
24             files[:] = [f for f in files if f.endswith('.py') and 'pydev' in f]
25         for f in files:
26             yield os.path.join(root[len(ptvsd_prefix) + 1:], f)
27 
28 setup(name='ptvsd',
29       version='4.0.0a1',
30       description='Visual Studio remote debugging server for Python',
31       license='MIT',
32       author='Microsoft Corporation',
33       author_email='ptvshelp@microsoft.com',
34       url='https://aka.ms/ptvs',
35       classifiers=[
36         'Development Status :: 3 - Alpha',
37         'Programming Language :: Python',
38         'Programming Language :: Python :: 2',
39         'Programming Language :: Python :: 3',
40         'License :: OSI Approved :: MIT License'],
41       packages=['ptvsd'],
42       package_data={'ptvsd': list(get_pydevd_package_data()) + ['ThirdPartyNotices.txt']},
43       ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',
44                              ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],
45                              optional=True)],
46       )
47
```
--- 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -6,6 +6,7 @@
 
 import os
 import os.path
+import sys
 from setuptools import setup, Extension
 
 ROOT = os.path.dirname(os.path.abspath(__file__))
@@ -25,6 +26,18 @@
         for f in files:
             yield os.path.join(root[len(ptvsd_prefix) + 1:], f)
 
+cmdclass = {}
+
+if sys.version_info[0] == 2:
+    from setuptools.command.build_ext import build_ext
+    class build_optional_ext(build_ext):
+        def build_extension(self, ext):
+            try:
+                super(build_optional_ext, self).build_extension(ext)
+            except:
+                pass
+    cmdclass = { 'build_ext': build_optional_ext }
+
 setup(name='ptvsd',
       version='4.0.0a1',
       description='Visual Studio remote debugging server for Python',
@@ -43,4 +56,5 @@
       ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',
                              ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],
                              optional=True)],
+      cmdclass=cmdclass,
       )

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -6,6 +6,7 @@\n \n import os\n import os.path\n+import sys\n from setuptools import setup, Extension\n \n ROOT = os.path.dirname(os.path.abspath(__file__))\n@@ -25,6 +26,18 @@\n         for f in files:\n             yield os.path.join(root[len(ptvsd_prefix) + 1:], f)\n \n+cmdclass = {}\n+\n+if sys.version_info[0] == 2:\n+    from setuptools.command.build_ext import build_ext\n+    class build_optional_ext(build_ext):\n+        def build_extension(self, ext):\n+            try:\n+                super(build_optional_ext, self).build_extension(ext)\n+            except:\n+                pass\n+    cmdclass = { 'build_ext': build_optional_ext }\n+\n setup(name='ptvsd',\n       version='4.0.0a1',\n       description='Visual Studio remote debugging server for Python',\n@@ -43,4 +56,5 @@\n       ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',\n                              ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],\n                              optional=True)],\n+      cmdclass=cmdclass,\n       )\n", "issue": "Pip Installing PTVSD fails \n* Python2.7\r\n* Pip install ptvsd from local source fails with the following error:\r\n```\r\nrunning build_ext\r\n    building 'ptvsd.pydevd._pydevd_bundle.pydevd_cython' extension\r\n    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\n\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport os\nimport os.path\nfrom setuptools import setup, Extension\n\nROOT = os.path.dirname(os.path.abspath(__file__))\n\n# Add pydevd files as data files for this package. They are not treated as a package of their own,\n# because we don't actually want to provide pydevd - just use our own copy internally.\ndef get_pydevd_package_data():\n    ptvsd_prefix = os.path.join(ROOT, 'ptvsd')\n    pydevd_prefix = os.path.join(ptvsd_prefix, 'pydevd')\n    for root, dirs, files in os.walk(pydevd_prefix):\n        # From the root of pydevd repo, we want only scripts and subdirectories that\n        # constitute the package itself (not helper scripts, tests etc). But when\n        # walking down into those subdirectories, we want everything below.\n        if os.path.normcase(root) == os.path.normcase(pydevd_prefix):\n            dirs[:] = [d for d in dirs if d.startswith('pydev') or d.startswith('_pydev')]\n            files[:] = [f for f in files if f.endswith('.py') and 'pydev' in f]\n        for f in files:\n            yield os.path.join(root[len(ptvsd_prefix) + 1:], f)\n\nsetup(name='ptvsd',\n      version='4.0.0a1',\n      description='Visual Studio remote debugging server for Python',\n      license='MIT',\n      author='Microsoft Corporation',\n      author_email='ptvshelp@microsoft.com',\n      url='https://aka.ms/ptvs',\n      classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 3',\n        'License :: OSI Approved :: MIT License'],\n      packages=['ptvsd'],\n      package_data={'ptvsd': list(get_pydevd_package_data()) + ['ThirdPartyNotices.txt']},\n      ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',\n                             ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],\n                             optional=True)],\n      )\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport os\nimport os.path\nimport sys\nfrom setuptools import setup, Extension\n\nROOT = os.path.dirname(os.path.abspath(__file__))\n\n# Add pydevd files as data files for this package. They are not treated as a package of their own,\n# because we don't actually want to provide pydevd - just use our own copy internally.\ndef get_pydevd_package_data():\n    ptvsd_prefix = os.path.join(ROOT, 'ptvsd')\n    pydevd_prefix = os.path.join(ptvsd_prefix, 'pydevd')\n    for root, dirs, files in os.walk(pydevd_prefix):\n        # From the root of pydevd repo, we want only scripts and subdirectories that\n        # constitute the package itself (not helper scripts, tests etc). But when\n        # walking down into those subdirectories, we want everything below.\n        if os.path.normcase(root) == os.path.normcase(pydevd_prefix):\n            dirs[:] = [d for d in dirs if d.startswith('pydev') or d.startswith('_pydev')]\n            files[:] = [f for f in files if f.endswith('.py') and 'pydev' in f]\n        for f in files:\n            yield os.path.join(root[len(ptvsd_prefix) + 1:], f)\n\ncmdclass = {}\n\nif sys.version_info[0] == 2:\n    from setuptools.command.build_ext import build_ext\n    class build_optional_ext(build_ext):\n        def build_extension(self, ext):\n            try:\n                super(build_optional_ext, self).build_extension(ext)\n            except:\n                pass\n    cmdclass = { 'build_ext': build_optional_ext }\n\nsetup(name='ptvsd',\n      version='4.0.0a1',\n      description='Visual Studio remote debugging server for Python',\n      license='MIT',\n      author='Microsoft Corporation',\n      author_email='ptvshelp@microsoft.com',\n      url='https://aka.ms/ptvs',\n      classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 3',\n        'License :: OSI Approved :: MIT License'],\n      packages=['ptvsd'],\n      package_data={'ptvsd': list(get_pydevd_package_data()) + ['ThirdPartyNotices.txt']},\n      ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',\n                             ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],\n                             optional=True)],\n      cmdclass=cmdclass,\n      )\n", "path": "setup.py"}]}