Mercurial > public > mercurial-scm > hg-stable
comparison contrib/win32/hgwebdir_wsgi.py @ 22198:77142de48ae4
cleanup: make sure we always access members of imported modules
This will make sure we get import errors, even if demandimport is enabled.
This will also mute some pyflakes 'imported but unused' warnings.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 15 Aug 2014 04:37:45 +0200 |
parents | e7cfe3587ea4 |
children | d3da97e58d42 |
comparison
equal
deleted
inserted
replaced
22197:f72d73937853 | 22198:77142de48ae4 |
---|---|
50 #sys.path.insert(0, r'c:\path\to\python\lib') | 50 #sys.path.insert(0, r'c:\path\to\python\lib') |
51 | 51 |
52 # Enable tracing. Run 'python -m win32traceutil' to debug | 52 # Enable tracing. Run 'python -m win32traceutil' to debug |
53 if getattr(sys, 'isapidllhandle', None) is not None: | 53 if getattr(sys, 'isapidllhandle', None) is not None: |
54 import win32traceutil | 54 import win32traceutil |
55 win32traceutil.SetupForPrint # silence unused import warning | |
55 | 56 |
56 # To serve pages in local charset instead of UTF-8, remove the two lines below | 57 # To serve pages in local charset instead of UTF-8, remove the two lines below |
57 import os | 58 import os |
58 os.environ['HGENCODING'] = 'UTF-8' | 59 os.environ['HGENCODING'] = 'UTF-8' |
59 | 60 |
88 | 89 |
89 def __ExtensionFactory__(): | 90 def __ExtensionFactory__(): |
90 return isapi_wsgi.ISAPISimpleHandler(handler) | 91 return isapi_wsgi.ISAPISimpleHandler(handler) |
91 | 92 |
92 if __name__=='__main__': | 93 if __name__=='__main__': |
93 from isapi.install import * | 94 from isapi.install import ISAPIParameters, HandleCommandLine |
94 params = ISAPIParameters() | 95 params = ISAPIParameters() |
95 HandleCommandLine(params) | 96 HandleCommandLine(params) |