prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  python compatibility about timezone parameter for widget.Clock
  # Issue description
  
  The following widget configuration doesn't  work for python 3.8.2:
  ```
  widget.Clock( format="%H:%M:%S", timezone="Asia/Taipei")
  ```
  
  I made a workaround for this:
  ```
  from dateutil.tz import *
  widget.Clock( format="%H:%M:%S", timezone=gettz("Asia/Taipei"))
  ```
  
  This error is related to the code snippets in `libqtile/widget/clock.py`:
  ```
      def poll(self):
          if self.timezone:
              now = datetime.now(timezone.utc).astimezone(self.timezone)
          else:
              now = datetime.now(timezone.utc).astimezone()
          return (now + self.DELTA).strftime(self.format)
  ```
  
  It seems python 3.6+ has compatibility issue of timezone parameters, and native python doesn't support timezone locale like "Asia/Tokyo","Europe/Warsaw", ... or so. Currently I include `dateutil` to bypass the syntax error
  
  
  # Qtile version
  qtile 0.15.1-1 (ArchLinux)
  
  
  
  </issue>
  <code>
  [start of libqtile/widget/clock.py]
  1 # Copyright (c) 2010 Aldo Cortesi
  2 # Copyright (c) 2012 Andrew Grigorev
  3 # Copyright (c) 2014 Sean Vig
  4 # Copyright (c) 2014 Tycho Andersen
  5 #
  6 # Permission is hereby granted, free of charge, to any person obtaining a copy
  7 # of this software and associated documentation files (the "Software"), to deal
  8 # in the Software without restriction, including without limitation the rights
  9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 # copies of the Software, and to permit persons to whom the Software is
  11 # furnished to do so, subject to the following conditions:
  12 #
  13 # The above copyright notice and this permission notice shall be included in
  14 # all copies or substantial portions of the Software.
  15 #
  16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22 # SOFTWARE.
  23 
  24 import sys
  25 import time
  26 from datetime import datetime, timedelta, timezone
  27 
  28 from libqtile.log_utils import logger
  29 from libqtile.widget import base
  30 
  31 try:
  32     import pytz
  33 except ImportError:
  34     pass
  35 
  36 
  37 class Clock(base.InLoopPollText):
  38     """A simple but flexible text-based clock"""
  39     orientations = base.ORIENTATION_HORIZONTAL
  40     defaults = [
  41         ('format', '%H:%M', 'A Python datetime format string'),
  42         ('update_interval', 1., 'Update interval for the clock'),
  43         ('timezone', None, 'The timezone to use for this clock, either as'
  44          ' string if pytz is installed (e.g. "US/Central" or anything in'
  45          ' /usr/share/zoneinfo), or as tzinfo (e.g. datetime.timezone.utc).'
  46          ' None means the system local timezone and is the default.')
  47     ]
  48     DELTA = timedelta(seconds=0.5)
  49 
  50     def __init__(self, **config):
  51         base.InLoopPollText.__init__(self, **config)
  52         self.add_defaults(Clock.defaults)
  53         if isinstance(self.timezone, str):
  54             if "pytz" in sys.modules:
  55                 self.timezone = pytz.timezone(self.timezone)
  56             else:
  57                 logger.warning('Clock widget can not infer its timezone from a'
  58                                ' string without the pytz library. Install pytz'
  59                                ' or give it a datetime.tzinfo instance.')
  60         if self.timezone is None:
  61             logger.info('Defaulting to the system local timezone.')
  62 
  63     def tick(self):
  64         self.update(self.poll())
  65         return self.update_interval - time.time() % self.update_interval
  66 
  67     # adding .5 to get a proper seconds value because glib could
  68     # theoreticaly call our method too early and we could get something
  69     # like (x-1).999 instead of x.000
  70     def poll(self):
  71         if self.timezone:
  72             now = datetime.now(timezone.utc).astimezone(self.timezone)
  73         else:
  74             now = datetime.now(timezone.utc).astimezone()
  75         return (now + self.DELTA).strftime(self.format)
  76
  [end of libqtile/widget/clock.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/libqtile/widget/clock.py b/libqtile/widget/clock.py
  --- a/libqtile/widget/clock.py
  +++ b/libqtile/widget/clock.py
  @@ -33,6 +33,11 @@
   except ImportError:
       pass
   
  +try:
  +    import dateutil.tz
  +except ImportError:
  +    pass
  +
   
   class Clock(base.InLoopPollText):
       """A simple but flexible text-based clock"""
  @@ -41,9 +46,10 @@
           ('format', '%H:%M', 'A Python datetime format string'),
           ('update_interval', 1., 'Update interval for the clock'),
           ('timezone', None, 'The timezone to use for this clock, either as'
  -         ' string if pytz is installed (e.g. "US/Central" or anything in'
  -         ' /usr/share/zoneinfo), or as tzinfo (e.g. datetime.timezone.utc).'
  -         ' None means the system local timezone and is the default.')
  +         ' string if pytz or dateutil is installed (e.g. "US/Central" or'
  +         ' anything in /usr/share/zoneinfo), or as tzinfo (e.g.'
  +         ' datetime.timezone.utc). None means the system local timezone and is'
  +         ' the default.')
       ]
       DELTA = timedelta(seconds=0.5)
   
  @@ -53,10 +59,13 @@
           if isinstance(self.timezone, str):
               if "pytz" in sys.modules:
                   self.timezone = pytz.timezone(self.timezone)
  +            elif "dateutil" in sys.modules:
  +                self.timezone = dateutil.tz.gettz(self.timezone)
               else:
                   logger.warning('Clock widget can not infer its timezone from a'
  -                               ' string without the pytz library. Install pytz'
  -                               ' or give it a datetime.tzinfo instance.')
  +                               ' string without pytz or dateutil. Install one'
  +                               ' of these libraries, or give it a'
  +                               ' datetime.tzinfo instance.')
           if self.timezone is None:
               logger.info('Defaulting to the system local timezone.')
  
verification_info: {"golden_diff": "diff --git a/libqtile/widget/clock.py b/libqtile/widget/clock.py\n--- a/libqtile/widget/clock.py\n+++ b/libqtile/widget/clock.py\n@@ -33,6 +33,11 @@\n except ImportError:\n     pass\n \n+try:\n+    import dateutil.tz\n+except ImportError:\n+    pass\n+\n \n class Clock(base.InLoopPollText):\n     \"\"\"A simple but flexible text-based clock\"\"\"\n@@ -41,9 +46,10 @@\n         ('format', '%H:%M', 'A Python datetime format string'),\n         ('update_interval', 1., 'Update interval for the clock'),\n         ('timezone', None, 'The timezone to use for this clock, either as'\n-         ' string if pytz is installed (e.g. \"US/Central\" or anything in'\n-         ' /usr/share/zoneinfo), or as tzinfo (e.g. datetime.timezone.utc).'\n-         ' None means the system local timezone and is the default.')\n+         ' string if pytz or dateutil is installed (e.g. \"US/Central\" or'\n+         ' anything in /usr/share/zoneinfo), or as tzinfo (e.g.'\n+         ' datetime.timezone.utc). None means the system local timezone and is'\n+         ' the default.')\n     ]\n     DELTA = timedelta(seconds=0.5)\n \n@@ -53,10 +59,13 @@\n         if isinstance(self.timezone, str):\n             if \"pytz\" in sys.modules:\n                 self.timezone = pytz.timezone(self.timezone)\n+            elif \"dateutil\" in sys.modules:\n+                self.timezone = dateutil.tz.gettz(self.timezone)\n             else:\n                 logger.warning('Clock widget can not infer its timezone from a'\n-                               ' string without the pytz library. Install pytz'\n-                               ' or give it a datetime.tzinfo instance.')\n+                               ' string without pytz or dateutil. Install one'\n+                               ' of these libraries, or give it a'\n+                               ' datetime.tzinfo instance.')\n         if self.timezone is None:\n             logger.info('Defaulting to the system local timezone.')\n", "issue": "python compatibility about timezone parameter for widget.Clock\n# Issue description\r\n\r\nThe following widget configuration doesn't  work for python 3.8.2:\r\n```\r\nwidget.Clock( format=\"%H:%M:%S\", timezone=\"Asia/Taipei\")\r\n```\r\n\r\nI made a workaround for this:\r\n```\r\nfrom dateutil.tz import *\r\nwidget.Clock( format=\"%H:%M:%S\", timezone=gettz(\"Asia/Taipei\"))\r\n```\r\n\r\nThis error is related to the code snippets in `libqtile/widget/clock.py`:\r\n```\r\n    def poll(self):\r\n        if self.timezone:\r\n            now = datetime.now(timezone.utc).astimezone(self.timezone)\r\n        else:\r\n            now = datetime.now(timezone.utc).astimezone()\r\n        return (now + self.DELTA).strftime(self.format)\r\n```\r\n\r\nIt seems python 3.6+ has compatibility issue of timezone parameters, and native python doesn't support timezone locale like \"Asia/Tokyo\",\"Europe/Warsaw\", ... or so. Currently I include `dateutil` to bypass the syntax error\r\n\r\n\r\n# Qtile version\r\nqtile 0.15.1-1 (ArchLinux)\r\n\r\n\n", "before_files": [{"content": "# Copyright (c) 2010 Aldo Cortesi\n# Copyright (c) 2012 Andrew Grigorev\n# Copyright (c) 2014 Sean Vig\n# Copyright (c) 2014 Tycho Andersen\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\nimport sys\nimport time\nfrom datetime import datetime, timedelta, timezone\n\nfrom libqtile.log_utils import logger\nfrom libqtile.widget import base\n\ntry:\n    import pytz\nexcept ImportError:\n    pass\n\n\nclass Clock(base.InLoopPollText):\n    \"\"\"A simple but flexible text-based clock\"\"\"\n    orientations = base.ORIENTATION_HORIZONTAL\n    defaults = [\n        ('format', '%H:%M', 'A Python datetime format string'),\n        ('update_interval', 1., 'Update interval for the clock'),\n        ('timezone', None, 'The timezone to use for this clock, either as'\n         ' string if pytz is installed (e.g. \"US/Central\" or anything in'\n         ' /usr/share/zoneinfo), or as tzinfo (e.g. datetime.timezone.utc).'\n         ' None means the system local timezone and is the default.')\n    ]\n    DELTA = timedelta(seconds=0.5)\n\n    def __init__(self, **config):\n        base.InLoopPollText.__init__(self, **config)\n        self.add_defaults(Clock.defaults)\n        if isinstance(self.timezone, str):\n            if \"pytz\" in sys.modules:\n                self.timezone = pytz.timezone(self.timezone)\n            else:\n                logger.warning('Clock widget can not infer its timezone from a'\n                               ' string without the pytz library. Install pytz'\n                               ' or give it a datetime.tzinfo instance.')\n        if self.timezone is None:\n            logger.info('Defaulting to the system local timezone.')\n\n    def tick(self):\n        self.update(self.poll())\n        return self.update_interval - time.time() % self.update_interval\n\n    # adding .5 to get a proper seconds value because glib could\n    # theoreticaly call our method too early and we could get something\n    # like (x-1).999 instead of x.000\n    def poll(self):\n        if self.timezone:\n            now = datetime.now(timezone.utc).astimezone(self.timezone)\n        else:\n            now = datetime.now(timezone.utc).astimezone()\n        return (now + self.DELTA).strftime(self.format)\n", "path": "libqtile/widget/clock.py"}]}