mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
Fixes running 'hg serve' with Windows executable and no explicit template path configured.
PY2EXE executables don't support __file__ but do place the directory of the shared code library into sys.prefix. Fixes bug 152.
This commit is contained in:
parent
766746eb79
commit
66b91019b7
@ -20,6 +20,10 @@ def templatepath():
|
||||
p = os.path.join(os.path.dirname(__file__), f)
|
||||
if os.path.isdir(p):
|
||||
return os.path.normpath(p)
|
||||
else:
|
||||
# executable version (py2exe) doesn't support __file__
|
||||
if hasattr(sys, 'frozen'):
|
||||
return os.path.join(sys.prefix, "templates")
|
||||
|
||||
def age(x):
|
||||
def plural(t, c):
|
||||
|
Loading…
Reference in New Issue
Block a user