Update hgweb to Python 3.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 23 Dec 2023 21:19:31 +0200
changeset 32 921746b84574
parent 31 461eed8e7463
child 33 7b602d7f98cd
Update hgweb to Python 3.
deb/apache-register-hg.bash
--- a/deb/apache-register-hg.bash	Mon Jul 31 01:24:19 2023 +0300
+++ b/deb/apache-register-hg.bash	Sat Dec 23 21:19:31 2023 +0200
@@ -9,14 +9,20 @@
 chown user:user /srv/hg
 
 cat <<EOF >/srv/hg/hgweb.cgi
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # See also https://mercurial-scm.org/wiki/PublishingRepositories
 
 # Path to repo or hgweb config to serve (see 'hg help hgweb')
-config = "/srv/hg/hgweb.config"
+config = b"/srv/hg/hgweb.config"
+
+# Uncomment to send python tracebacks to the browser if an error occurs:
+# import cgitb; cgitb.enable()
 
-from mercurial import demandimport; demandimport.enable()
+from mercurial import demandimport
+demandimport.enable()
+
 from mercurial.hgweb import hgweb, wsgicgi
+
 application = hgweb(config)
 wsgicgi.launch(application)
 EOF