comparison hgpaste/factory.py @ 8:49e931b5c8e2 default tip

encode to bytes for mercurial
author Jeff Hammel <k0scist@gmail.com>
date Tue, 24 Nov 2020 08:53:32 -0800
parents 0dc878f8a15f
children
comparison
equal deleted inserted replaced
7:0dc878f8a15f 8:49e931b5c8e2
1 __all__ = ['wsgi_app', 'make_app'] 1 __all__ = ['wsgi_app', 'make_app']
2 2
3 3
4 def wsgi_app(config_file): 4 def wsgi_app(config_file):
5 """wsgi application""" 5 """wsgi application"""
6
7 if isinstance(config_file, str):
8 # Encode to bytes for mercurial API
9 config_file = config_file.encode()
6 from mercurial import demandimport; demandimport.enable() 10 from mercurial import demandimport; demandimport.enable()
7 from mercurial.hgweb.hgwebdir_mod import hgwebdir 11 from mercurial.hgweb.hgwebdir_mod import hgwebdir
8 application = hgwebdir(config_file) 12 application = hgwebdir(config_file)
9 return application 13 return application
10 14