Skip to content

Commit

Permalink
Use ConfigParser for py>=3.2 (SciTools#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
tv3141 authored and pelson committed May 23, 2018
1 parent c20219d commit 40be11b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/iris/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2017, Met Office
# (C) British Crown Copyright 2010 - 2018, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -48,6 +48,7 @@

import contextlib
import os.path
import sys
import warnings


Expand Down Expand Up @@ -91,7 +92,10 @@ def get_dir_option(section, option, default=None):
CONFIG_PATH = os.path.join(ROOT_PATH, 'etc')

# Load the optional "site.cfg" file if it exists.
config = configparser.SafeConfigParser()
if sys.version_info >= (3, 2):
config = configparser.ConfigParser()
else:
config = configparser.SafeConfigParser()
config.read([os.path.join(CONFIG_PATH, 'site.cfg')])


Expand Down

0 comments on commit 40be11b

Please sign in to comment.