diff --git a/modules/bnporc/company/browser.py b/modules/bnporc/company/browser.py
index 4eb1aee366a02ac1e2b54cd94b04a1e251c7aa39..07ee0c77d66b7807db4ef0570874ce3c18b49aba 100644
--- a/modules/bnporc/company/browser.py
+++ b/modules/bnporc/company/browser.py
@@ -17,11 +17,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
+
from datetime import date, timedelta
from weboob.browser import LoginBrowser, URL, need_login
from weboob.capabilities.base import find_object
from weboob.capabilities.bank import AccountNotFound
+from weboob.tools.compat import basestring
from .pages import LoginPage, AccountsPage, HistoryPage
diff --git a/modules/bnporc/company/pages.py b/modules/bnporc/company/pages.py
index e1642c67a619d5226f2611640abc83daab8874f3..3c9da7fd8b047ea5e8d9adbfdf71e92609db1696 100644
--- a/modules/bnporc/company/pages.py
+++ b/modules/bnporc/company/pages.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
+
from io import BytesIO
import hashlib
from decimal import Decimal
diff --git a/modules/bnporc/enterprise/browser.py b/modules/bnporc/enterprise/browser.py
index f1da4353249e89a5c9f31dc87f2de3477ab42974..cd6a8b944e0a62f52a05d62604edcdd03c649cfe 100644
--- a/modules/bnporc/enterprise/browser.py
+++ b/modules/bnporc/enterprise/browser.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
+
import re
from datetime import datetime
diff --git a/modules/bnporc/enterprise/pages.py b/modules/bnporc/enterprise/pages.py
index 8c717876fd50285a5cf1fad5b31cf481c1d56541..297b20efddf91ba866e53937ce35ce2e0532d834 100644
--- a/modules/bnporc/enterprise/pages.py
+++ b/modules/bnporc/enterprise/pages.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
+
import re
from datetime import datetime
diff --git a/modules/bnporc/module.py b/modules/bnporc/module.py
index fbf68c2e18d100d50a8687f46d65a3211eddb606..26046535ceed245916330141a8fda2ba7c4113bc 100644
--- a/modules/bnporc/module.py
+++ b/modules/bnporc/module.py
@@ -17,6 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
import re
from decimal import Decimal
diff --git a/modules/bnporc/pp/pages.py b/modules/bnporc/pp/pages.py
index 2b0cb78386b3fc138c9b7ea298a3d91dcc5632eb..4cb0ad2704d0a4e97203dd241dbcf62fcaa5e1b0 100644
--- a/modules/bnporc/pp/pages.py
+++ b/modules/bnporc/pp/pages.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
+from __future__ import unicode_literals
+
from collections import Counter
import re
from io import BytesIO
@@ -157,7 +159,7 @@ def render_template(tmpl, **values):
@staticmethod
def generate_token(length=11):
chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'
- return ''.join((chars[randint(0, len(chars)-1)] for _ in xrange(length)))
+ return ''.join((chars[randint(0, len(chars)-1)] for _ in range(length)))
def build_doc(self, text):
try:
diff --git a/tools/py3-compatible.modules b/tools/py3-compatible.modules
index d9a7ee4b617bab3ca74adb0f415f194bc46ab0cf..06a3b2664bf401b04e9e7a774cf0deeb1b018c47 100644
--- a/tools/py3-compatible.modules
+++ b/tools/py3-compatible.modules
@@ -25,6 +25,7 @@ binck
biplan
blablacar
blogspot
+bnporc
bnppere
boursorama
bp