prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Error running build_package.py
  When running build_package, it fails as curl is not available:
  ```txt
  Traceback (most recent call last):
    File "build_package.py", line 43, in <module>
      subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
    File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
      retcode = call(*popenargs, **kwargs)
    File "/usr/lib/python3.8/subprocess.py", line 340, in call
      with Popen(*popenargs, **kwargs) as p:
    File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'curl'
  ```
  
  </issue>
  <code>
  [start of build_package.py]
  1 # Copyright (c) Microsoft Corporation.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 # http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 import glob
  16 import os
  17 import shutil
  18 import stat
  19 import subprocess
  20 import sys
  21 import zipfile
  22 
  23 from playwright.path_utils import get_file_dirname
  24 
  25 driver_version_64 = "0.170.0-next.1605305660869"
  26 driver_version_32 = "0.170.0-next.1605305685932"
  27 
  28 
  29 def driver_version(platform: str) -> str:
  30     return driver_version_32 if platform == "win32" else driver_version_64
  31 
  32 
  33 if not os.path.exists("driver"):
  34     os.makedirs("driver")
  35 if not os.path.exists("playwright/driver"):
  36     os.makedirs("playwright/driver")
  37 
  38 for platform in ["mac", "linux", "win32", "win32_x64"]:
  39     zip_file = f"playwright-cli-{driver_version(platform)}-{platform}.zip"
  40     if not os.path.exists("driver/" + zip_file):
  41         url = "https://playwright.azureedge.net/builds/cli/next/" + zip_file
  42         print("Fetching ", url)
  43         subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
  44 
  45 _dirname = get_file_dirname()
  46 _build_dir = _dirname / "build"
  47 if _build_dir.exists():
  48     shutil.rmtree(_build_dir)
  49 _dist_dir = _dirname / "dist"
  50 if _dist_dir.exists():
  51     shutil.rmtree(_dist_dir)
  52 _egg_dir = _dirname / "playwright.egg-info"
  53 if _egg_dir.exists():
  54     shutil.rmtree(_egg_dir)
  55 
  56 subprocess.check_call("python setup.py sdist bdist_wheel", shell=True)
  57 
  58 base_wheel_location = glob.glob("dist/*.whl")[0]
  59 without_platform = base_wheel_location[:-7]
  60 
  61 platform_map = {
  62     "darwin": "mac",
  63     "linux": "linux",
  64     "win32": "win32_x64" if sys.maxsize > 2 ** 32 else "win32",
  65 }
  66 
  67 for platform in ["mac", "linux", "win32", "win32_x64"]:
  68     zip_file = f"driver/playwright-cli-{driver_version(platform)}-{platform}.zip"
  69     with zipfile.ZipFile(zip_file, "r") as zip:
  70         zip.extractall(f"driver/{platform}")
  71     if platform_map[sys.platform] == platform:
  72         with zipfile.ZipFile(zip_file, "r") as zip:
  73             zip.extractall("playwright/driver")
  74         for file in os.listdir("playwright/driver"):
  75             if file == "playwright-cli" or file.startswith("ffmpeg"):
  76                 print(f"playwright/driver/{file}")
  77                 os.chmod(
  78                     f"playwright/driver/{file}",
  79                     os.stat(f"playwright/driver/{file}").st_mode | stat.S_IEXEC,
  80                 )
  81 
  82     wheel = ""
  83     if platform == "mac":
  84         wheel = "macosx_10_13_x86_64.whl"
  85     if platform == "linux":
  86         wheel = "manylinux1_x86_64.whl"
  87     if platform == "win32":
  88         wheel = "win32.whl"
  89     if platform == "win32_x64":
  90         wheel = "win_amd64.whl"
  91     wheel_location = without_platform + wheel
  92     shutil.copy(base_wheel_location, wheel_location)
  93     with zipfile.ZipFile(wheel_location, "a") as zip:
  94         for file in os.listdir(f"driver/{platform}"):
  95             from_location = f"driver/{platform}/{file}"
  96             to_location = f"playwright/driver/{file}"
  97             if file == "playwright-cli" or file.startswith("ffmpeg"):
  98                 os.chmod(from_location, os.stat(from_location).st_mode | stat.S_IEXEC)
  99             zip.write(from_location, to_location)
  100 
  101 os.remove(base_wheel_location)
  102
  [end of build_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/build_package.py b/build_package.py
  --- a/build_package.py
  +++ b/build_package.py
  @@ -18,6 +18,7 @@
   import stat
   import subprocess
   import sys
  +import urllib.request
   import zipfile
   
   from playwright.path_utils import get_file_dirname
  @@ -40,7 +41,7 @@
       if not os.path.exists("driver/" + zip_file):
           url = "https://playwright.azureedge.net/builds/cli/next/" + zip_file
           print("Fetching ", url)
  -        subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
  +        urllib.request.urlretrieve(url, "driver/" + zip_file)
   
   _dirname = get_file_dirname()
   _build_dir = _dirname / "build"
  
verification_info: {"golden_diff": "diff --git a/build_package.py b/build_package.py\n--- a/build_package.py\n+++ b/build_package.py\n@@ -18,6 +18,7 @@\n import stat\n import subprocess\n import sys\n+import urllib.request\n import zipfile\n \n from playwright.path_utils import get_file_dirname\n@@ -40,7 +41,7 @@\n     if not os.path.exists(\"driver/\" + zip_file):\n         url = \"https://playwright.azureedge.net/builds/cli/next/\" + zip_file\n         print(\"Fetching \", url)\n-        subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\n+        urllib.request.urlretrieve(url, \"driver/\" + zip_file)\n \n _dirname = get_file_dirname()\n _build_dir = _dirname / \"build\"\n", "issue": "Error running build_package.py\nWhen running build_package, it fails as curl is not available:\r\n```txt\r\nTraceback (most recent call last):\r\n  File \"build_package.py\", line 43, in <module>\r\n    subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 359, in check_call\r\n    retcode = call(*popenargs, **kwargs)\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 340, in call\r\n    with Popen(*popenargs, **kwargs) as p:\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 854, in __init__\r\n    self._execute_child(args, executable, preexec_fn, close_fds,\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 1702, in _execute_child\r\n    raise child_exception_type(errno_num, err_msg, err_filename)\r\nFileNotFoundError: [Errno 2] No such file or directory: 'curl'\r\n```\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport glob\nimport os\nimport shutil\nimport stat\nimport subprocess\nimport sys\nimport zipfile\n\nfrom playwright.path_utils import get_file_dirname\n\ndriver_version_64 = \"0.170.0-next.1605305660869\"\ndriver_version_32 = \"0.170.0-next.1605305685932\"\n\n\ndef driver_version(platform: str) -> str:\n    return driver_version_32 if platform == \"win32\" else driver_version_64\n\n\nif not os.path.exists(\"driver\"):\n    os.makedirs(\"driver\")\nif not os.path.exists(\"playwright/driver\"):\n    os.makedirs(\"playwright/driver\")\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    if not os.path.exists(\"driver/\" + zip_file):\n        url = \"https://playwright.azureedge.net/builds/cli/next/\" + zip_file\n        print(\"Fetching \", url)\n        subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\n\n_dirname = get_file_dirname()\n_build_dir = _dirname / \"build\"\nif _build_dir.exists():\n    shutil.rmtree(_build_dir)\n_dist_dir = _dirname / \"dist\"\nif _dist_dir.exists():\n    shutil.rmtree(_dist_dir)\n_egg_dir = _dirname / \"playwright.egg-info\"\nif _egg_dir.exists():\n    shutil.rmtree(_egg_dir)\n\nsubprocess.check_call(\"python setup.py sdist bdist_wheel\", shell=True)\n\nbase_wheel_location = glob.glob(\"dist/*.whl\")[0]\nwithout_platform = base_wheel_location[:-7]\n\nplatform_map = {\n    \"darwin\": \"mac\",\n    \"linux\": \"linux\",\n    \"win32\": \"win32_x64\" if sys.maxsize > 2 ** 32 else \"win32\",\n}\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"driver/playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    with zipfile.ZipFile(zip_file, \"r\") as zip:\n        zip.extractall(f\"driver/{platform}\")\n    if platform_map[sys.platform] == platform:\n        with zipfile.ZipFile(zip_file, \"r\") as zip:\n            zip.extractall(\"playwright/driver\")\n        for file in os.listdir(\"playwright/driver\"):\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                print(f\"playwright/driver/{file}\")\n                os.chmod(\n                    f\"playwright/driver/{file}\",\n                    os.stat(f\"playwright/driver/{file}\").st_mode | stat.S_IEXEC,\n                )\n\n    wheel = \"\"\n    if platform == \"mac\":\n        wheel = \"macosx_10_13_x86_64.whl\"\n    if platform == \"linux\":\n        wheel = \"manylinux1_x86_64.whl\"\n    if platform == \"win32\":\n        wheel = \"win32.whl\"\n    if platform == \"win32_x64\":\n        wheel = \"win_amd64.whl\"\n    wheel_location = without_platform + wheel\n    shutil.copy(base_wheel_location, wheel_location)\n    with zipfile.ZipFile(wheel_location, \"a\") as zip:\n        for file in os.listdir(f\"driver/{platform}\"):\n            from_location = f\"driver/{platform}/{file}\"\n            to_location = f\"playwright/driver/{file}\"\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                os.chmod(from_location, os.stat(from_location).st_mode | stat.S_IEXEC)\n            zip.write(from_location, to_location)\n\nos.remove(base_wheel_location)\n", "path": "build_package.py"}]}