mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
Fixed ConfigParser for Python 3 compat
This commit is contained in:
parent
046bd3d955
commit
afd92820f7
1 changed files with 11 additions and 2 deletions
|
|
@ -1,9 +1,18 @@
|
|||
#
|
||||
# This loads the configuration
|
||||
#
|
||||
import ConfigParser
|
||||
import os
|
||||
config = ConfigParser.ConfigParser()
|
||||
try:
|
||||
#Attempt Python 2 ConfigParser setup
|
||||
import ConfigParser
|
||||
config = ConfigParser.ConfigParser()
|
||||
except ImportError:
|
||||
#Attempt Python 3 ConfigParser setup
|
||||
import configparser
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
|
||||
|
||||
|
||||
# This is the default configuration file that always needs to be present.
|
||||
default_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'defaults.cfg'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue