prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  AppVeyor: AttributeError: 'module' object has no attribute 'get_pid_list
  https://ci.appveyor.com/project/mpi4py/mpi4py/build/2.0.0a0-17/job/965h1pw9k7476768#L1187
  
  conda info:
  https://ci.appveyor.com/project/mpi4py/mpi4py/build/2.0.0a0-17/job/965h1pw9k7476768#L1076
  
  Please note a few lines above I ran:
  `C:\Anaconda\Scripts\conda.exe install --yes --quiet anaconda-client conda-build jinja2`
  
  
  </issue>
  <code>
  [start of conda_build/windows.py]
  1 from __future__ import absolute_import, division, print_function
  2 
  3 import os
  4 import sys
  5 import shutil
  6 from os.path import dirname, isdir, isfile, join, exists
  7 
  8 import conda.config as cc
  9 from conda.compat import iteritems
  10 
  11 from conda_build.config import config
  12 from conda_build import environ
  13 from conda_build import source
  14 from conda_build.utils import _check_call
  15 
  16 try:
  17     import psutil
  18 except ImportError:
  19     psutil = None
  20 
  21 assert sys.platform == 'win32'
  22 
  23 
  24 def fix_staged_scripts():
  25     """
  26     Fixes scripts which have been installed unix-style to have a .bat
  27     helper
  28     """
  29     scripts_dir = join(config.build_prefix, 'Scripts')
  30     if not isdir(scripts_dir):
  31         return
  32     for fn in os.listdir(scripts_dir):
  33         # process all the extensionless files
  34         if not isfile(join(scripts_dir, fn)) or '.' in fn:
  35             continue
  36 
  37         with open(join(scripts_dir, fn)) as f:
  38             line = f.readline().lower()
  39             # If it's a #!python script
  40             if not (line.startswith('#!') and 'python' in line.lower()):
  41                 continue
  42             print('Adjusting unix-style #! script %s, '
  43                   'and adding a .bat file for it' % fn)
  44             # copy it with a .py extension (skipping that first #! line)
  45             with open(join(scripts_dir, fn + '-script.py'), 'w') as fo:
  46                 fo.write(f.read())
  47             # now create the .exe file
  48             shutil.copyfile(join(dirname(__file__),
  49                                  'cli-%d.exe' % (8 * tuple.__itemsize__)),
  50                             join(scripts_dir, fn + '.exe'))
  51 
  52         # remove the original script
  53         os.remove(join(scripts_dir, fn))
  54 
  55 
  56 def msvc_env_cmd():
  57     if 'ProgramFiles(x86)' in os.environ:
  58         program_files = os.environ['ProgramFiles(x86)']
  59     else:
  60         program_files = os.environ['ProgramFiles']
  61 
  62     localappdata = os.environ.get("localappdata")
  63 
  64     if config.PY3K:
  65         vcvarsall = os.path.join(program_files,
  66                                  r'Microsoft Visual Studio 10.0'
  67                                  r'\VC\vcvarsall.bat')
  68     else:
  69         vcvarsall = os.path.join(program_files,
  70                                  r'Microsoft Visual Studio 9.0'
  71                                  r'\VC\vcvarsall.bat')
  72 
  73     # Try the Microsoft Visual C++ Compiler for Python 2.7
  74     if not isfile(vcvarsall) and localappdata and not config.PY3K:
  75         vcvarsall = os.path.join(localappdata, "Programs", "Common",
  76             "Microsoft", "Visual C++ for Python", "9.0", "vcvarsall.bat")
  77     if not isfile(vcvarsall) and program_files and not config.PY3K:
  78         vcvarsall = os.path.join(program_files, 'Common Files',
  79             'Microsoft', 'Visual C++ for Python', "9.0", "vcvarsall.bat")
  80     if not isfile(vcvarsall):
  81         print("Warning: Couldn't find Visual Studio: %r" % vcvarsall)
  82         return ''
  83 
  84     return '''\
  85 call "%s" %s
  86 ''' % (vcvarsall, {32: 'x86', 64: 'amd64'}[cc.bits])
  87 
  88 
  89 def kill_processes():
  90     if psutil is None:
  91         return
  92     for n in psutil.get_pid_list():
  93         try:
  94             p = psutil.Process(n)
  95             if p.name.lower() == 'msbuild.exe':
  96                 print('Terminating:', p.name)
  97                 p.terminate()
  98         except:
  99             continue
  100 
  101 
  102 def build(m):
  103     env = dict(os.environ)
  104     env.update(environ.get_dict(m))
  105 
  106     for name in 'BIN', 'INC', 'LIB':
  107         path = env['LIBRARY_' + name]
  108         if not isdir(path):
  109             os.makedirs(path)
  110 
  111     src_dir = source.get_dir()
  112     bld_bat = join(m.path, 'bld.bat')
  113     if exists(bld_bat):
  114         with open(bld_bat) as fi:
  115             data = fi.read()
  116         with open(join(src_dir, 'bld.bat'), 'w') as fo:
  117             fo.write(msvc_env_cmd())
  118             for kv in iteritems(env):
  119                 fo.write('set "%s=%s"\n' % kv)
  120             # more debuggable with echo on
  121             fo.write('@echo on\n')
  122             fo.write("REM ===== end generated header =====\n")
  123             fo.write(data)
  124 
  125         cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']
  126         _check_call(cmd, cwd=src_dir)
  127         kill_processes()
  128         fix_staged_scripts()
  129
  [end of conda_build/windows.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/conda_build/windows.py b/conda_build/windows.py
  --- a/conda_build/windows.py
  +++ b/conda_build/windows.py
  @@ -89,7 +89,7 @@
   def kill_processes():
       if psutil is None:
           return
  -    for n in psutil.get_pid_list():
  +    for n in psutil.pids():
           try:
               p = psutil.Process(n)
               if p.name.lower() == 'msbuild.exe':
  
verification_info: {"golden_diff": "diff --git a/conda_build/windows.py b/conda_build/windows.py\n--- a/conda_build/windows.py\n+++ b/conda_build/windows.py\n@@ -89,7 +89,7 @@\n def kill_processes():\n     if psutil is None:\n         return\n-    for n in psutil.get_pid_list():\n+    for n in psutil.pids():\n         try:\n             p = psutil.Process(n)\n             if p.name.lower() == 'msbuild.exe':\n", "issue": "AppVeyor: AttributeError: 'module' object has no attribute 'get_pid_list\nhttps://ci.appveyor.com/project/mpi4py/mpi4py/build/2.0.0a0-17/job/965h1pw9k7476768#L1187\n\nconda info:\nhttps://ci.appveyor.com/project/mpi4py/mpi4py/build/2.0.0a0-17/job/965h1pw9k7476768#L1076\n\nPlease note a few lines above I ran:\n`C:\\Anaconda\\Scripts\\conda.exe install --yes --quiet anaconda-client conda-build jinja2`\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function\n\nimport os\nimport sys\nimport shutil\nfrom os.path import dirname, isdir, isfile, join, exists\n\nimport conda.config as cc\nfrom conda.compat import iteritems\n\nfrom conda_build.config import config\nfrom conda_build import environ\nfrom conda_build import source\nfrom conda_build.utils import _check_call\n\ntry:\n    import psutil\nexcept ImportError:\n    psutil = None\n\nassert sys.platform == 'win32'\n\n\ndef fix_staged_scripts():\n    \"\"\"\n    Fixes scripts which have been installed unix-style to have a .bat\n    helper\n    \"\"\"\n    scripts_dir = join(config.build_prefix, 'Scripts')\n    if not isdir(scripts_dir):\n        return\n    for fn in os.listdir(scripts_dir):\n        # process all the extensionless files\n        if not isfile(join(scripts_dir, fn)) or '.' in fn:\n            continue\n\n        with open(join(scripts_dir, fn)) as f:\n            line = f.readline().lower()\n            # If it's a #!python script\n            if not (line.startswith('#!') and 'python' in line.lower()):\n                continue\n            print('Adjusting unix-style #! script %s, '\n                  'and adding a .bat file for it' % fn)\n            # copy it with a .py extension (skipping that first #! line)\n            with open(join(scripts_dir, fn + '-script.py'), 'w') as fo:\n                fo.write(f.read())\n            # now create the .exe file\n            shutil.copyfile(join(dirname(__file__),\n                                 'cli-%d.exe' % (8 * tuple.__itemsize__)),\n                            join(scripts_dir, fn + '.exe'))\n\n        # remove the original script\n        os.remove(join(scripts_dir, fn))\n\n\ndef msvc_env_cmd():\n    if 'ProgramFiles(x86)' in os.environ:\n        program_files = os.environ['ProgramFiles(x86)']\n    else:\n        program_files = os.environ['ProgramFiles']\n\n    localappdata = os.environ.get(\"localappdata\")\n\n    if config.PY3K:\n        vcvarsall = os.path.join(program_files,\n                                 r'Microsoft Visual Studio 10.0'\n                                 r'\\VC\\vcvarsall.bat')\n    else:\n        vcvarsall = os.path.join(program_files,\n                                 r'Microsoft Visual Studio 9.0'\n                                 r'\\VC\\vcvarsall.bat')\n\n    # Try the Microsoft Visual C++ Compiler for Python 2.7\n    if not isfile(vcvarsall) and localappdata and not config.PY3K:\n        vcvarsall = os.path.join(localappdata, \"Programs\", \"Common\",\n            \"Microsoft\", \"Visual C++ for Python\", \"9.0\", \"vcvarsall.bat\")\n    if not isfile(vcvarsall) and program_files and not config.PY3K:\n        vcvarsall = os.path.join(program_files, 'Common Files',\n            'Microsoft', 'Visual C++ for Python', \"9.0\", \"vcvarsall.bat\")\n    if not isfile(vcvarsall):\n        print(\"Warning: Couldn't find Visual Studio: %r\" % vcvarsall)\n        return ''\n\n    return '''\\\ncall \"%s\" %s\n''' % (vcvarsall, {32: 'x86', 64: 'amd64'}[cc.bits])\n\n\ndef kill_processes():\n    if psutil is None:\n        return\n    for n in psutil.get_pid_list():\n        try:\n            p = psutil.Process(n)\n            if p.name.lower() == 'msbuild.exe':\n                print('Terminating:', p.name)\n                p.terminate()\n        except:\n            continue\n\n\ndef build(m):\n    env = dict(os.environ)\n    env.update(environ.get_dict(m))\n\n    for name in 'BIN', 'INC', 'LIB':\n        path = env['LIBRARY_' + name]\n        if not isdir(path):\n            os.makedirs(path)\n\n    src_dir = source.get_dir()\n    bld_bat = join(m.path, 'bld.bat')\n    if exists(bld_bat):\n        with open(bld_bat) as fi:\n            data = fi.read()\n        with open(join(src_dir, 'bld.bat'), 'w') as fo:\n            fo.write(msvc_env_cmd())\n            for kv in iteritems(env):\n                fo.write('set \"%s=%s\"\\n' % kv)\n            # more debuggable with echo on\n            fo.write('@echo on\\n')\n            fo.write(\"REM ===== end generated header =====\\n\")\n            fo.write(data)\n\n        cmd = [os.environ['COMSPEC'], '/c', 'call', 'bld.bat']\n        _check_call(cmd, cwd=src_dir)\n        kill_processes()\n        fix_staged_scripts()\n", "path": "conda_build/windows.py"}]}