prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Installation issue: py-adios
  ### Steps to reproduce the issue
  ```console
  $ spack install -j 64 py-adios ^python@3.0:
  ```
  
  The result is lots of errors like:
  ```adios_mpi.cpp:47080:21: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?```
  
  And similar.
  
  ### Platform and user environment
  ```commandline
  $ uname -a
  Linux quokka1.ccs.ornl.gov 4.14.0-115.el7a.aarch64 #1 SMP Tue Sep 25 12:32:51 EDT 2018 aarch64 aarch64 aarch64 GNU/Linux
  ``` 
  
  ### Additional information
  py-adios includes a file (adios_mpi.cpp) which was generated using Cython 0.28.2.  This version of Cython generates code that won't compile against the Python 3.7 C API.  (This was fixed in the 0.29 release.)  The Adios developers have been notified (https://github.com/ornladios/ADIOS/issues/202).
  
  I think the workaround is to add a ```depends_on()``` line for python <=3.6.x.  If/when the issue is fixed in Adios, we can add a ```when``` clause to the dependency.  I'll issue a pull request shortly.
  
  
  </issue>
  <code>
  [start of var/spack/repos/builtin/packages/py-adios/package.py]
  1 # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
  2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
  3 #
  4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
  5 
  6 from spack import *
  7 
  8 
  9 class PyAdios(PythonPackage):
  10     """NumPy bindings of ADIOS1"""
  11 
  12     homepage = "https://www.olcf.ornl.gov/center-projects/adios/"
  13     url      = "https://github.com/ornladios/ADIOS/archive/v1.12.0.tar.gz"
  14     git      = "https://github.com/ornladios/ADIOS.git"
  15 
  16     maintainers = ['ax3l']
  17 
  18     version('develop', branch='master')
  19     version('1.13.0', '68af36b821debbdf4748b20320a990ce')
  20     version('1.12.0', '84a1c71b6698009224f6f748c5257fc9')
  21     version('1.11.1', '5639bfc235e50bf17ba9dafb14ea4185')
  22     version('1.11.0', '5eead5b2ccf962f5e6d5f254d29d5238')
  23     version('1.10.0', 'eff450a4c0130479417cfd63186957f3')
  24     version('1.9.0', '310ff02388bbaa2b1c1710ee970b5678')
  25 
  26     variant('mpi', default=True,
  27             description='Enable MPI support')
  28 
  29     for v in ['1.9.0', '1.10.0', '1.11.0', '1.11.1', '1.12.0', '1.13.0',
  30               'develop']:
  31         depends_on('adios@{0} ~mpi'.format(v),
  32                    when='@{0} ~mpi'.format(v),
  33                    type=['build', 'link', 'run'])
  34         depends_on('adios@{0} +mpi'.format(v),
  35                    when='@{0} +mpi'.format(v),
  36                    type=['build', 'link', 'run'])
  37 
  38     depends_on('py-numpy', type=['build', 'run'])
  39     depends_on('mpi', when='+mpi')
  40     depends_on('py-mpi4py', type=['run'], when='+mpi')
  41     depends_on('py-cython', type=['build'])
  42 
  43     phases = ['build_clib', 'install']
  44     build_directory = 'wrappers/numpy'
  45 
  46     def setup_file(self):
  47         """Returns the name of the setup file to use."""
  48         if '+mpi' in self.spec:
  49             return 'setup_mpi.py'
  50         else:
  51             return 'setup.py'
  52 
  53     def build_clib(self, spec, prefix):
  54         # calls: make [MPI=y] python
  55         args = ''
  56         if '+mpi' in self.spec:
  57             args = 'MPI=y '
  58         args += 'python'
  59         with working_dir(self.build_directory):
  60             make(args)
  61
  [end of var/spack/repos/builtin/packages/py-adios/package.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/var/spack/repos/builtin/packages/py-adios/package.py b/var/spack/repos/builtin/packages/py-adios/package.py
  --- a/var/spack/repos/builtin/packages/py-adios/package.py
  +++ b/var/spack/repos/builtin/packages/py-adios/package.py
  @@ -35,6 +35,14 @@
                      when='@{0} +mpi'.format(v),
                      type=['build', 'link', 'run'])
   
  +    # NOTE: this dependency is a work-around for a bug in Adios itself.
  +    # Specifically, Adios uses code that was generated by Cython 0.28.2.
  +    # This code won't compile against the Python 3.7 C API.
  +    # See https://github.com/ornladios/ADIOS/issues/202 and
  +    # the first entry under "Bug Fixes" at
  +    # https://github.com/cython/cython/blob/0.29.x/CHANGES.rst
  +    depends_on('python@:3.6')
  +
       depends_on('py-numpy', type=['build', 'run'])
       depends_on('mpi', when='+mpi')
       depends_on('py-mpi4py', type=['run'], when='+mpi')
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/py-adios/package.py b/var/spack/repos/builtin/packages/py-adios/package.py\n--- a/var/spack/repos/builtin/packages/py-adios/package.py\n+++ b/var/spack/repos/builtin/packages/py-adios/package.py\n@@ -35,6 +35,14 @@\n                    when='@{0} +mpi'.format(v),\n                    type=['build', 'link', 'run'])\n \n+    # NOTE: this dependency is a work-around for a bug in Adios itself.\n+    # Specifically, Adios uses code that was generated by Cython 0.28.2.\n+    # This code won't compile against the Python 3.7 C API.\n+    # See https://github.com/ornladios/ADIOS/issues/202 and\n+    # the first entry under \"Bug Fixes\" at\n+    # https://github.com/cython/cython/blob/0.29.x/CHANGES.rst\n+    depends_on('python@:3.6')\n+\n     depends_on('py-numpy', type=['build', 'run'])\n     depends_on('mpi', when='+mpi')\n     depends_on('py-mpi4py', type=['run'], when='+mpi')\n", "issue": "Installation issue: py-adios\n### Steps to reproduce the issue\r\n```console\r\n$ spack install -j 64 py-adios ^python@3.0:\r\n```\r\n\r\nThe result is lots of errors like:\r\n```adios_mpi.cpp:47080:21: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?```\r\n\r\nAnd similar.\r\n\r\n### Platform and user environment\r\n```commandline\r\n$ uname -a\r\nLinux quokka1.ccs.ornl.gov 4.14.0-115.el7a.aarch64 #1 SMP Tue Sep 25 12:32:51 EDT 2018 aarch64 aarch64 aarch64 GNU/Linux\r\n``` \r\n\r\n### Additional information\r\npy-adios includes a file (adios_mpi.cpp) which was generated using Cython 0.28.2.  This version of Cython generates code that won't compile against the Python 3.7 C API.  (This was fixed in the 0.29 release.)  The Adios developers have been notified (https://github.com/ornladios/ADIOS/issues/202).\r\n\r\nI think the workaround is to add a ```depends_on()``` line for python <=3.6.x.  If/when the issue is fixed in Adios, we can add a ```when``` clause to the dependency.  I'll issue a pull request shortly.\r\n\n", "before_files": [{"content": "# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass PyAdios(PythonPackage):\n    \"\"\"NumPy bindings of ADIOS1\"\"\"\n\n    homepage = \"https://www.olcf.ornl.gov/center-projects/adios/\"\n    url      = \"https://github.com/ornladios/ADIOS/archive/v1.12.0.tar.gz\"\n    git      = \"https://github.com/ornladios/ADIOS.git\"\n\n    maintainers = ['ax3l']\n\n    version('develop', branch='master')\n    version('1.13.0', '68af36b821debbdf4748b20320a990ce')\n    version('1.12.0', '84a1c71b6698009224f6f748c5257fc9')\n    version('1.11.1', '5639bfc235e50bf17ba9dafb14ea4185')\n    version('1.11.0', '5eead5b2ccf962f5e6d5f254d29d5238')\n    version('1.10.0', 'eff450a4c0130479417cfd63186957f3')\n    version('1.9.0', '310ff02388bbaa2b1c1710ee970b5678')\n\n    variant('mpi', default=True,\n            description='Enable MPI support')\n\n    for v in ['1.9.0', '1.10.0', '1.11.0', '1.11.1', '1.12.0', '1.13.0',\n              'develop']:\n        depends_on('adios@{0} ~mpi'.format(v),\n                   when='@{0} ~mpi'.format(v),\n                   type=['build', 'link', 'run'])\n        depends_on('adios@{0} +mpi'.format(v),\n                   when='@{0} +mpi'.format(v),\n                   type=['build', 'link', 'run'])\n\n    depends_on('py-numpy', type=['build', 'run'])\n    depends_on('mpi', when='+mpi')\n    depends_on('py-mpi4py', type=['run'], when='+mpi')\n    depends_on('py-cython', type=['build'])\n\n    phases = ['build_clib', 'install']\n    build_directory = 'wrappers/numpy'\n\n    def setup_file(self):\n        \"\"\"Returns the name of the setup file to use.\"\"\"\n        if '+mpi' in self.spec:\n            return 'setup_mpi.py'\n        else:\n            return 'setup.py'\n\n    def build_clib(self, spec, prefix):\n        # calls: make [MPI=y] python\n        args = ''\n        if '+mpi' in self.spec:\n            args = 'MPI=y '\n        args += 'python'\n        with working_dir(self.build_directory):\n            make(args)\n", "path": "var/spack/repos/builtin/packages/py-adios/package.py"}]}