From 5c59b1992edaec8f8032df99061b32e08eb08091 Mon Sep 17 00:00:00 2001 From: Chris Warrick Date: Thu, 21 May 2015 16:41:19 +0200 Subject: [PATCH] version-dependent str type Signed-off-by: Chris Warrick --- nikola/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nikola/utils.py b/nikola/utils.py index c647945b10..de0672ba60 100644 --- a/nikola/utils.py +++ b/nikola/utils.py @@ -1148,8 +1148,13 @@ def get_root_dir(): """Find root directory of nikola installation by looking for conf.py""" root = os.getcwd() + if sys.version_info[0] == 3: + confname = b'conf.py' + else: + confname = 'conf.py' + while True: - if os.path.exists(os.path.join(root, b'conf.py')): + if os.path.exists(os.path.join(root, confname)): return root else: basedir = os.path.split(root)[0]