e09b1b1dd5e9076155458418fc7161e3022690f1 max Wed Oct 2 02:07:21 2019 -0700 adding six to hgLib, refs #24240 diff --git src/hg/pyLib/hgLib.py src/hg/pyLib/hgLib.py index a856e61..9edf74b 100644 --- src/hg/pyLib/hgLib.py +++ src/hg/pyLib/hgLib.py @@ -12,31 +12,31 @@ # - never print incoming HTTP argument as raw text. Run it through cgi.escape to # destroy javascript code in them. # Non-standard imports. They need to be installed on the machine. # We provide a pre-compiled library as part of our cgi-bin distribution as a # fallback in the "pyLib" directory. The idea of having pyLib be the last # directory in sys.path is that the system MySQLdb takes precedence. try: import MySQLdb except: print("Installation error - could not load MySQLdb for Python. Please tell your system administrator to run " \ "one of these commands as root: 'yum install MySQL-python', 'apt-get install python-mysqldb' or 'pip install MySQL-python'.") exit(0) # Imports from the Python 2.7 standard library -# Please minimize global imports. Each library import can take up to 20msecs. +# This is a CGI, not a WSGI - minimize global imports. Each library import can take up to 20msecs. import os, cgi, sys, logging, time from os.path import join, isfile, normpath, abspath, dirname, isdir, splitext from collections import namedtuple # start to support both python2 and python3 from six.moves import http_cookies, urllib # activate debugging output output only on dev import platform if "hgwdev" in platform.node(): import cgitb cgitb.enable() # debug level: a number. the higher, the more debug info is printed