Unverified Commit 36bcb170 authored by NilacTheGrim's avatar NilacTheGrim
Browse files

Fixup for Python 3.10

Closes issue #109.  Long story short: a few names from collection are
now moved to collection.abc exclusively starting in Python 3.10. The
only name this app uses from there that was moved is
`collections.Iterable`.  Python versions starting from 3.3 support both
`collections.Iterable` and `collections.abc.Iterable` as the way to refer to
this class, which Python 3.10 being the first one to drop
`collections.Iterable`.  So.. we just work around this API quirk
and always refer ot it as `collections.abc.Iterable`.
parent f8717b4b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ If you're fine with allowing your script to raise exceptions then this can be mo
import asyncio
import calendar
import collections
import collections.abc
import datetime
import functools
import inspect
@@ -2496,7 +2497,7 @@ class Controller(BaseController):
    for param, value in params_list:
      if isinstance(value, str):
        query_comp.append('%s="%s"' % (param, value.strip()))
      elif isinstance(value, collections.Iterable):
      elif isinstance(value, collections.abc.Iterable):
        query_comp.extend(['%s="%s"' % (param, val.strip()) for val in value])
      elif not value:
        query_comp.append(param)