prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Installed through dependencies "websocket" library doesn't work with Python 3
  During `pip install docker-py` with Python 3 I'm getting following error:
  
  ```
    Running setup.py install for websocket-client
      changing mode of build/scripts-3.3/wsdump.py from 644 to 755
        File "/home/bob/env/lib/python3.3/site-packages/websocket.py", line 769
          except Exception, e:
                          ^
      SyntaxError: invalid syntax
  ```
  
  Looks like this error is ignored and actually docker finishes it's installation and works afterwards, but if docker-py uses websocket library it's usage will fail.
  
  According to websocket docs they have separate branch for Python 3: https://github.com/liris/websocket-client/tree/py3
  
  
  --- 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 import os
  3 from setuptools import setup
  4 
  5 ROOT_DIR = os.path.dirname(__file__)
  6 SOURCE_DIR = os.path.join(ROOT_DIR)
  7 
  8 test_requirements = []
  9 with open('./requirements.txt') as requirements_txt:
  10     requirements = [line for line in requirements_txt]
  11 
  12 setup(
  13     name="docker-py",
  14     version='0.3.0',
  15     description="Python client for Docker.",
  16     packages=['docker', 'docker.auth', 'docker.unixconn', 'docker.utils'],
  17     install_requires=requirements + test_requirements,
  18     zip_safe=False,
  19     test_suite='tests',
  20     classifiers=[
  21         'Development Status :: 4 - Beta',
  22         'Environment :: Other Environment',
  23         'Intended Audience :: Developers',
  24         'Operating System :: OS Independent',
  25         'Programming Language :: Python',
  26         'Programming Language :: Python :: 2.6',
  27         'Programming Language :: Python :: 2.7',
  28         'Programming Language :: Python :: 3.2',
  29         'Programming Language :: Python :: 3.3',
  30         'Topic :: Utilities',
  31         'License :: OSI Approved :: Apache Software License',
  32     ],
  33 )
  34
  ```
  --- 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
  @@ -1,12 +1,18 @@
   #!/usr/bin/env python
   import os
  +import sys
   from setuptools import setup
   
   ROOT_DIR = os.path.dirname(__file__)
   SOURCE_DIR = os.path.join(ROOT_DIR)
   
  +if sys.version_info[0] == 3:
  +    requirements_file = './requirements3.txt'
  +else:
  +    requirements_file = './requirements.txt'
  +
   test_requirements = []
  -with open('./requirements.txt') as requirements_txt:
  +with open(requirements_file) as requirements_txt:
       requirements = [line for line in requirements_txt]
   
   setup(
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,12 +1,18 @@\n #!/usr/bin/env python\n import os\n+import sys\n from setuptools import setup\n \n ROOT_DIR = os.path.dirname(__file__)\n SOURCE_DIR = os.path.join(ROOT_DIR)\n \n+if sys.version_info[0] == 3:\n+    requirements_file = './requirements3.txt'\n+else:\n+    requirements_file = './requirements.txt'\n+\n test_requirements = []\n-with open('./requirements.txt') as requirements_txt:\n+with open(requirements_file) as requirements_txt:\n     requirements = [line for line in requirements_txt]\n \n setup(\n", "issue": "Installed through dependencies \"websocket\" library doesn't work with Python 3\nDuring `pip install docker-py` with Python 3 I'm getting following error:\n\n```\n  Running setup.py install for websocket-client\n    changing mode of build/scripts-3.3/wsdump.py from 644 to 755\n      File \"/home/bob/env/lib/python3.3/site-packages/websocket.py\", line 769\n        except Exception, e:\n                        ^\n    SyntaxError: invalid syntax\n```\n\nLooks like this error is ignored and actually docker finishes it's installation and works afterwards, but if docker-py uses websocket library it's usage will fail.\n\nAccording to websocket docs they have separate branch for Python 3: https://github.com/liris/websocket-client/tree/py3\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport os\nfrom setuptools import setup\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\ntest_requirements = []\nwith open('./requirements.txt') as requirements_txt:\n    requirements = [line for line in requirements_txt]\n\nsetup(\n    name=\"docker-py\",\n    version='0.3.0',\n    description=\"Python client for Docker.\",\n    packages=['docker', 'docker.auth', 'docker.unixconn', 'docker.utils'],\n    install_requires=requirements + test_requirements,\n    zip_safe=False,\n    test_suite='tests',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Other Environment',\n        'Intended Audience :: Developers',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.2',\n        'Programming Language :: Python :: 3.3',\n        'Topic :: Utilities',\n        'License :: OSI Approved :: Apache Software License',\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport os\nimport sys\nfrom setuptools import setup\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\nif sys.version_info[0] == 3:\n    requirements_file = './requirements3.txt'\nelse:\n    requirements_file = './requirements.txt'\n\ntest_requirements = []\nwith open(requirements_file) as requirements_txt:\n    requirements = [line for line in requirements_txt]\n\nsetup(\n    name=\"docker-py\",\n    version='0.3.0',\n    description=\"Python client for Docker.\",\n    packages=['docker', 'docker.auth', 'docker.unixconn', 'docker.utils'],\n    install_requires=requirements + test_requirements,\n    zip_safe=False,\n    test_suite='tests',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Other Environment',\n        'Intended Audience :: Developers',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.2',\n        'Programming Language :: Python :: 3.3',\n        'Topic :: Utilities',\n        'License :: OSI Approved :: Apache Software License',\n    ],\n)\n", "path": "setup.py"}]}