mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
This commit is contained in:
parent
219905a3be
commit
75ec8f27d5
@ -194,8 +194,9 @@ class Config(object):
|
||||
# we promise to have the config dir as current dir while the
|
||||
# config file is executed
|
||||
os.chdir(dirname)
|
||||
# get config source
|
||||
f = open(config_file, 'rU')
|
||||
# get config source -- 'b' is a no-op under 2.x, while 'U' is
|
||||
# ignored under 3.x (but 3.x compile() accepts \r\n newlines)
|
||||
f = open(config_file, 'rbU')
|
||||
try:
|
||||
source = f.read()
|
||||
finally:
|
||||
|
@ -91,7 +91,7 @@ def test_quickstart_defaults(tempdir):
|
||||
conffile = tempdir / 'conf.py'
|
||||
assert conffile.isfile()
|
||||
ns = {}
|
||||
f = open(conffile, 'U')
|
||||
f = open(conffile, 'rbU')
|
||||
try:
|
||||
code = compile(f.read(), conffile, 'exec')
|
||||
finally:
|
||||
@ -151,7 +151,7 @@ def test_quickstart_all_answers(tempdir):
|
||||
conffile = tempdir / 'source' / 'conf.py'
|
||||
assert conffile.isfile()
|
||||
ns = {}
|
||||
f = open(conffile, 'U')
|
||||
f = open(conffile, 'rbU')
|
||||
try:
|
||||
code = compile(f.read(), conffile, 'exec')
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user