Mercurial > hg > mercurial-crew-with-dirclash
comparison hgwebdir.cgi @ 5197:55860a45bbf2
Enable demandimport only in scripts, not in importable modules (issue605)
This way other applications can choose if and when they want this feature,
because it might be problematic if those applications rely on ImportError.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 18 Aug 2007 11:37:08 +0200 |
parents | 6033d9f28052 |
children | 79279b5583c6 |
comparison
equal
deleted
inserted
replaced
5196:86e95b93559a | 5197:55860a45bbf2 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # An example CGI script to export multiple hgweb repos, edit as necessary | 3 # An example CGI script to export multiple hgweb repos, edit as necessary |
4 | |
5 # enable importing on demand to reduce startup time | |
6 from mercurial import demandimport; demandimport.enable() | |
4 | 7 |
5 # send python tracebacks to the browser if an error occurs: | 8 # send python tracebacks to the browser if an error occurs: |
6 import cgitb | 9 import cgitb |
7 cgitb.enable() | 10 cgitb.enable() |
8 | 11 |