prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  readthedocs.org builds are broken
  The docs fail to build for a while, but differently since https://github.com/Gallopsled/pwntools/pull/2179. They're still built using Python 2.7, which had problems installing rpyc and is now missing the toml package before running the setup.py.
  
  https://readthedocs.org/projects/pwntools/builds/
  
  You could switch to Python 3 or try adding the `toml; python_version<'3.4'` package to the `docs/requirements.txt` file for a starter? I think only a maintainer with access to the configs can fix this.
  
  </issue>
  <code>
  [start of pwn/toplevel.py]
  1 # Get all the modules from pwnlib
  2 import collections
  3 import logging
  4 import math
  5 import operator
  6 import os
  7 import platform
  8 import re
  9 import socks
  10 import signal
  11 import string
  12 import struct
  13 import subprocess
  14 import sys
  15 import tempfile
  16 import threading
  17 import time
  18 
  19 import colored_traceback
  20 from pprint import pprint
  21 
  22 import pwnlib
  23 from pwnlib import *
  24 from pwnlib.asm import *
  25 from pwnlib.context import Thread
  26 from pwnlib.context import context, LocalContext
  27 from pwnlib.dynelf import DynELF
  28 from pwnlib.encoders import *
  29 from pwnlib.elf.corefile import Core, Corefile, Coredump
  30 from pwnlib.elf.elf import ELF, load
  31 from pwnlib.encoders import *
  32 from pwnlib.exception import PwnlibException
  33 from pwnlib.gdb import attach, debug_assembly, debug_shellcode
  34 from pwnlib.filepointer import *
  35 from pwnlib.filesystem import *
  36 from pwnlib.flag import *
  37 from pwnlib.fmtstr import FmtStr, fmtstr_payload, fmtstr_split
  38 from pwnlib.log import getLogger
  39 from pwnlib.memleak import MemLeak, RelativeMemLeak
  40 from pwnlib.regsort import *
  41 from pwnlib.replacements import *
  42 from pwnlib.rop import ROP
  43 from pwnlib.rop.call import AppendedArgument
  44 from pwnlib.rop.srop import SigreturnFrame
  45 from pwnlib.rop.ret2dlresolve import Ret2dlresolvePayload
  46 from pwnlib.runner import *
  47 from pwnlib.term.readline import str_input
  48 from pwnlib.timeout import Timeout
  49 from pwnlib.tubes.listen import listen
  50 from pwnlib.tubes.process import process, PTY, PIPE, STDOUT
  51 from pwnlib.tubes.remote import remote, tcp, udp, connect
  52 from pwnlib.tubes.serialtube import serialtube
  53 from pwnlib.tubes.server import server
  54 from pwnlib.tubes.ssh import ssh
  55 from pwnlib.tubes.tube import tube
  56 from pwnlib.ui import *
  57 from pwnlib.util import crc
  58 from pwnlib.util import iters
  59 from pwnlib.util import net
  60 from pwnlib.util import proc
  61 from pwnlib.util import safeeval
  62 from pwnlib.util.crc import BitPolynom
  63 from pwnlib.util.cyclic import *
  64 from pwnlib.util.fiddling import *
  65 from pwnlib.util.getdents import *
  66 from pwnlib.util.hashes import *
  67 from pwnlib.util.lists import *
  68 from pwnlib.util.misc import *
  69 from pwnlib.util.packing import *
  70 from pwnlib.util.proc import pidof
  71 from pwnlib.util.sh_string import sh_string, sh_prepare, sh_command_with
  72 from pwnlib.util.splash import *
  73 from pwnlib.util.web import *
  74 
  75 # Promote these modules, so that "from pwn import *" will let you access them
  76 
  77 from six.moves import cPickle as pickle, cStringIO as StringIO
  78 from six import BytesIO
  79 
  80 log = getLogger("pwnlib.exploit")
  81 error   = log.error
  82 warning = log.warning
  83 warn    = log.warning
  84 info    = log.info
  85 debug   = log.debug
  86 success = log.success
  87 
  88 colored_traceback.add_hook()
  89 
  90 # Equivalence with the default behavior of "from import *"
  91 # __all__ = [x for x in tuple(globals()) if not x.startswith('_')]
  92
  [end of pwn/toplevel.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/pwn/toplevel.py b/pwn/toplevel.py
  --- a/pwn/toplevel.py
  +++ b/pwn/toplevel.py
  @@ -16,7 +16,6 @@
   import threading
   import time
   
  -import colored_traceback
   from pprint import pprint
   
   import pwnlib
  @@ -85,7 +84,12 @@
   debug   = log.debug
   success = log.success
   
  -colored_traceback.add_hook()
  +try:
  +    import colored_traceback
  +except ImportError:
  +    pass
  +else:
  +    colored_traceback.add_hook()
   
   # Equivalence with the default behavior of "from import *"
   # __all__ = [x for x in tuple(globals()) if not x.startswith('_')]
  
verification_info: {"golden_diff": "diff --git a/pwn/toplevel.py b/pwn/toplevel.py\n--- a/pwn/toplevel.py\n+++ b/pwn/toplevel.py\n@@ -16,7 +16,6 @@\n import threading\n import time\n \n-import colored_traceback\n from pprint import pprint\n \n import pwnlib\n@@ -85,7 +84,12 @@\n debug   = log.debug\n success = log.success\n \n-colored_traceback.add_hook()\n+try:\n+    import colored_traceback\n+except ImportError:\n+    pass\n+else:\n+    colored_traceback.add_hook()\n \n # Equivalence with the default behavior of \"from import *\"\n # __all__ = [x for x in tuple(globals()) if not x.startswith('_')]\n", "issue": "readthedocs.org builds are broken\nThe docs fail to build for a while, but differently since https://github.com/Gallopsled/pwntools/pull/2179. They're still built using Python 2.7, which had problems installing rpyc and is now missing the toml package before running the setup.py.\r\n\r\nhttps://readthedocs.org/projects/pwntools/builds/\r\n\r\nYou could switch to Python 3 or try adding the `toml; python_version<'3.4'` package to the `docs/requirements.txt` file for a starter? I think only a maintainer with access to the configs can fix this.\n", "before_files": [{"content": "# Get all the modules from pwnlib\nimport collections\nimport logging\nimport math\nimport operator\nimport os\nimport platform\nimport re\nimport socks\nimport signal\nimport string\nimport struct\nimport subprocess\nimport sys\nimport tempfile\nimport threading\nimport time\n\nimport colored_traceback\nfrom pprint import pprint\n\nimport pwnlib\nfrom pwnlib import *\nfrom pwnlib.asm import *\nfrom pwnlib.context import Thread\nfrom pwnlib.context import context, LocalContext\nfrom pwnlib.dynelf import DynELF\nfrom pwnlib.encoders import *\nfrom pwnlib.elf.corefile import Core, Corefile, Coredump\nfrom pwnlib.elf.elf import ELF, load\nfrom pwnlib.encoders import *\nfrom pwnlib.exception import PwnlibException\nfrom pwnlib.gdb import attach, debug_assembly, debug_shellcode\nfrom pwnlib.filepointer import *\nfrom pwnlib.filesystem import *\nfrom pwnlib.flag import *\nfrom pwnlib.fmtstr import FmtStr, fmtstr_payload, fmtstr_split\nfrom pwnlib.log import getLogger\nfrom pwnlib.memleak import MemLeak, RelativeMemLeak\nfrom pwnlib.regsort import *\nfrom pwnlib.replacements import *\nfrom pwnlib.rop import ROP\nfrom pwnlib.rop.call import AppendedArgument\nfrom pwnlib.rop.srop import SigreturnFrame\nfrom pwnlib.rop.ret2dlresolve import Ret2dlresolvePayload\nfrom pwnlib.runner import *\nfrom pwnlib.term.readline import str_input\nfrom pwnlib.timeout import Timeout\nfrom pwnlib.tubes.listen import listen\nfrom pwnlib.tubes.process import process, PTY, PIPE, STDOUT\nfrom pwnlib.tubes.remote import remote, tcp, udp, connect\nfrom pwnlib.tubes.serialtube import serialtube\nfrom pwnlib.tubes.server import server\nfrom pwnlib.tubes.ssh import ssh\nfrom pwnlib.tubes.tube import tube\nfrom pwnlib.ui import *\nfrom pwnlib.util import crc\nfrom pwnlib.util import iters\nfrom pwnlib.util import net\nfrom pwnlib.util import proc\nfrom pwnlib.util import safeeval\nfrom pwnlib.util.crc import BitPolynom\nfrom pwnlib.util.cyclic import *\nfrom pwnlib.util.fiddling import *\nfrom pwnlib.util.getdents import *\nfrom pwnlib.util.hashes import *\nfrom pwnlib.util.lists import *\nfrom pwnlib.util.misc import *\nfrom pwnlib.util.packing import *\nfrom pwnlib.util.proc import pidof\nfrom pwnlib.util.sh_string import sh_string, sh_prepare, sh_command_with\nfrom pwnlib.util.splash import *\nfrom pwnlib.util.web import *\n\n# Promote these modules, so that \"from pwn import *\" will let you access them\n\nfrom six.moves import cPickle as pickle, cStringIO as StringIO\nfrom six import BytesIO\n\nlog = getLogger(\"pwnlib.exploit\")\nerror   = log.error\nwarning = log.warning\nwarn    = log.warning\ninfo    = log.info\ndebug   = log.debug\nsuccess = log.success\n\ncolored_traceback.add_hook()\n\n# Equivalence with the default behavior of \"from import *\"\n# __all__ = [x for x in tuple(globals()) if not x.startswith('_')]\n", "path": "pwn/toplevel.py"}]}