prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Error reading integer
  From VS (might not be a ptvsd bug, not sure at this point):
  Create new python application
  Add new item, python unit test
  Set the unit test as startup file
  F5
  
  Result:
  ```
  ---------------------------
  Microsoft Visual Studio
  ---------------------------
  Error reading integer. Unexpected token: Boolean. Path 'exitCode'.
  ---------------------------
  OK   
  ---------------------------
  ```
  
  </issue>
  <code>
  [start of ptvsd/debugger.py]
  1 # Copyright (c) Microsoft Corporation. All rights reserved.
  2 # Licensed under the MIT License. See LICENSE in the project root
  3 # for license information.
  4 
  5 import sys
  6 
  7 
  8 __author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
  9 __version__ = "4.0.0a1"
  10 
  11 DONT_DEBUG = []
  12 
  13 
  14 def debug(filename, port_num, debug_id, debug_options, run_as):
  15     # TODO: docstring
  16 
  17     # import the wrapper first, so that it gets a chance
  18     # to detour pydevd socket functionality.
  19     import ptvsd.wrapper
  20     import pydevd
  21 
  22     args = [
  23             '--port', str(port_num),
  24             '--client', '127.0.0.1',
  25             ]
  26     if run_as == 'module':
  27         args.append('--module')
  28         args.extend(('--file', filename + ":"))
  29     else:
  30         args.extend(('--file', filename))
  31     sys.argv[1:0] = args
  32     try:
  33         pydevd.main()
  34     except SystemExit as ex:
  35         ptvsd.wrapper.ptvsd_sys_exit_code = ex.code
  36         raise
  37
  [end of ptvsd/debugger.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/ptvsd/debugger.py b/ptvsd/debugger.py
  --- a/ptvsd/debugger.py
  +++ b/ptvsd/debugger.py
  @@ -32,5 +32,5 @@
       try:
           pydevd.main()
       except SystemExit as ex:
  -        ptvsd.wrapper.ptvsd_sys_exit_code = ex.code
  +        ptvsd.wrapper.ptvsd_sys_exit_code = int(ex.code)
           raise
  
verification_info: {"golden_diff": "diff --git a/ptvsd/debugger.py b/ptvsd/debugger.py\n--- a/ptvsd/debugger.py\n+++ b/ptvsd/debugger.py\n@@ -32,5 +32,5 @@\n     try:\n         pydevd.main()\n     except SystemExit as ex:\n-        ptvsd.wrapper.ptvsd_sys_exit_code = ex.code\n+        ptvsd.wrapper.ptvsd_sys_exit_code = int(ex.code)\n         raise\n", "issue": "Error reading integer\nFrom VS (might not be a ptvsd bug, not sure at this point):\r\nCreate new python application\r\nAdd new item, python unit test\r\nSet the unit test as startup file\r\nF5\r\n\r\nResult:\r\n```\r\n---------------------------\r\nMicrosoft Visual Studio\r\n---------------------------\r\nError reading integer. Unexpected token: Boolean. Path 'exitCode'.\r\n---------------------------\r\nOK   \r\n---------------------------\r\n```\n", "before_files": [{"content": "# 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 sys\n\n\n__author__ = \"Microsoft Corporation <ptvshelp@microsoft.com>\"\n__version__ = \"4.0.0a1\"\n\nDONT_DEBUG = []\n\n\ndef debug(filename, port_num, debug_id, debug_options, run_as):\n    # TODO: docstring\n\n    # import the wrapper first, so that it gets a chance\n    # to detour pydevd socket functionality.\n    import ptvsd.wrapper\n    import pydevd\n\n    args = [\n            '--port', str(port_num),\n            '--client', '127.0.0.1',\n            ]\n    if run_as == 'module':\n        args.append('--module')\n        args.extend(('--file', filename + \":\"))\n    else:\n        args.extend(('--file', filename))\n    sys.argv[1:0] = args\n    try:\n        pydevd.main()\n    except SystemExit as ex:\n        ptvsd.wrapper.ptvsd_sys_exit_code = ex.code\n        raise\n", "path": "ptvsd/debugger.py"}]}