| .. | .. |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | import os |
|---|
| 5 | 5 | import sys |
|---|
| 6 | | -from sphinx.util.pycompat import execfile_ |
|---|
| 6 | +from sphinx.util.osutil import fs_encoding |
|---|
| 7 | 7 | |
|---|
| 8 | 8 | # ------------------------------------------------------------------------------ |
|---|
| 9 | 9 | def loadConfig(namespace): |
|---|
| .. | .. |
|---|
| 48 | 48 | sys.stdout.write("load additional sphinx-config: %s\n" % config_file) |
|---|
| 49 | 49 | config = namespace.copy() |
|---|
| 50 | 50 | config['__file__'] = config_file |
|---|
| 51 | | - execfile_(config_file, config) |
|---|
| 51 | + with open(config_file, 'rb') as f: |
|---|
| 52 | + code = compile(f.read(), fs_encoding, 'exec') |
|---|
| 53 | + exec(code, config) |
|---|
| 52 | 54 | del config['__file__'] |
|---|
| 53 | 55 | namespace.update(config) |
|---|
| 54 | 56 | else: |
|---|