From 960247a8fbef3e45d525620da03dde71ef3ca815 Mon Sep 17 00:00:00 2001 From: rachmadani haryono Date: Sun, 9 Feb 2020 08:33:49 +0800 Subject: [PATCH] fix: dev: use ImportError instead ModuleNotFoundError (#437) py3.5 compatibility --- bukuserver/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bukuserver/server.py b/bukuserver/server.py index 8ada3b7..c971e80 100644 --- a/bukuserver/server.py +++ b/bukuserver/server.py @@ -16,7 +16,7 @@ from flask_bootstrap import Bootstrap from flask_paginate import Pagination, get_page_parameter, get_per_page_parameter try: from flask_reverse_proxy_fix.middleware import ReverseProxyPrefixFix -except ModuleNotFoundError: +except ImportError: ReverseProxyPrefixFix = None from markupsafe import Markup import click @@ -242,7 +242,7 @@ def create_app(db_file=None): if ReverseProxyPrefixFix: ReverseProxyPrefixFix(app) else: - raise ModuleNotFoundError('Failed to import ReverseProxyPrefixFix') + raise ImportError('Failed to import ReverseProxyPrefixFix') bukudb = BukuDb(dbfile=app.config['BUKUSERVER_DB_FILE']) app.app_context().push() setattr(flask.g, 'bukudb', bukudb)