From 670c8a2cc1c3bbfd438c00eb51745023304af3c4 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Thu, 9 Mar 2017 15:21:52 +0000 Subject: [PATCH] Disable HTMLMIN with Python 2.6 as it doesn't work on that older version. --- web/config.py | 2 ++ web/pgadmin/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/config.py b/web/config.py index 80ae45377..676977eb8 100644 --- a/web/config.py +++ b/web/config.py @@ -172,6 +172,8 @@ SECURITY_PASSWORD_HASH = 'pbkdf2_sha512' # configuration databases 'keys' table and are auto-generated. # Should HTML be minified on the fly when not in debug mode? +# NOTE: The HTMLMIN module doesn't work with Python 2.6, so this option +# has no effect on <= Python 2.7. MINIFY_PAGE = True ########################################################################## diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index 047d925d6..1a1432515 100644 --- a/web/pgadmin/__init__.py +++ b/web/pgadmin/__init__.py @@ -450,7 +450,8 @@ def create_app(app_name=None): ########################################################################## # Minify output ########################################################################## - if not config.DEBUG: + # HTMLMIN doesn't work with Python 2.6. + if not config.DEBUG and sys.version_info >= (2,7): HTMLMIN(app) @app.context_processor