From bb2a835565cc2f5170f385e762357f6e7a34397d Mon Sep 17 00:00:00 2001 From: Sergio Morillo Date: Tue, 12 Mar 2019 18:16:54 +0100 Subject: [PATCH] Migrate to python3 --- aeat.py | 2 +- aeat_mapping.py | 2 +- setup.py | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/aeat.py b/aeat.py index 634a762..c1e69ec 100644 --- a/aeat.py +++ b/aeat.py @@ -229,7 +229,7 @@ def remove_accents(unicode_string): unicode_string_nfd = ''.join( (c for c in unicodedata.normalize('NFD', unicode_string) if (unicodedata.category(c) != 'Mn' - or c in ('\u0327', '\u0303')) # ç or ñ + or c in ('\\u0327', '\\u0303')) # ç or ñ )) # It converts nfd to nfc to allow unicode.decode() return unicodedata.normalize('NFC', unicode_string_nfd) diff --git a/aeat_mapping.py b/aeat_mapping.py index af6aafd..0d047ed 100644 --- a/aeat_mapping.py +++ b/aeat_mapping.py @@ -58,7 +58,7 @@ class BaseTrytonInvoiceMapper(Model): for tax in taxes: base = tax.company_base parent = tax.tax.parent if tax.tax.parent else tax.tax - if parent.id in taxes_used.keys() and base == taxes_used[parent.id]: + if parent.id in list(taxes_used.keys()) and base == taxes_used[parent.id]: continue total += (base + tax.company_amount) taxes_used[parent.id] = base diff --git a/setup.py b/setup.py index 9efd8b6..f875659 100644 --- a/setup.py +++ b/setup.py @@ -95,10 +95,10 @@ setup(name='%s_%s' % (PREFIX, MODULE), 'Natural Language :: Russian', 'Natural Language :: Spanish', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Office/Business', @@ -114,8 +114,4 @@ setup(name='%s_%s' % (PREFIX, MODULE), test_suite='tests', test_loader='trytond.test_loader:Loader', tests_require=tests_require, - use_2to3=True, - convert_2to3_doctests=[ - 'tests/scenario_aeat_sii.rst', - ], )