Mercurial > p > roundup > code
comparison roundup/rest.py @ 7684:3eca3462ba0c
fix: add support for dicttoxml2.py
The older dicttoxml.py uses a type alias collections.Iterator that is
removed post Python 3.10. Add support for dictoxml.py updated
replacement.
Norbert SCHLEMMER found it when testing the arm docker under 3.12.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 26 Oct 2023 11:24:04 -0400 |
| parents | b04e222501b8 |
| children | 6f66d74d37f3 |
comparison
equal
deleted
inserted
replaced
| 7683:b04e222501b8 | 7684:3eca3462ba0c |
|---|---|
| 33 from roundup.rate_limit import RateLimit, Gcra | 33 from roundup.rate_limit import RateLimit, Gcra |
| 34 | 34 |
| 35 logger = logging.getLogger('roundup.rest') | 35 logger = logging.getLogger('roundup.rest') |
| 36 | 36 |
| 37 try: | 37 try: |
| 38 # if dicttoxml installed in roundup directory, use it | 38 # if dicttoxml2 (or dicttoxml for Python <= 3.6) |
| 39 from roundup.dicttoxml import dicttoxml | 39 # is installed in roundup directory, use it |
| 40 from roundup.dicttoxml2 import dicttoxml | |
| 40 except ImportError: | 41 except ImportError: |
| 41 try: | 42 try: |
| 42 # else look in sys.path | 43 # else look in sys.path |
| 43 from dicttoxml import dicttoxml | 44 from dicttoxml2 import dicttoxml |
| 44 except ImportError: | 45 except ImportError: |
| 45 # else not supported | 46 try: |
| 46 dicttoxml = None | 47 from roundup.dicttoxml import dicttoxml |
| 48 except ImportError: | |
| 49 try: | |
| 50 # else look in sys.path | |
| 51 from dicttoxml import dicttoxml | |
| 52 except ImportError: | |
| 53 # else not supported | |
| 54 dicttoxml = None | |
| 47 | 55 |
| 48 # Py3 compatible basestring | 56 # Py3 compatible basestring |
| 49 try: | 57 try: |
| 50 basestring | 58 basestring |
| 51 except NameError: | 59 except NameError: |
