fix library path issue when no configuration file exists, #265
This commit is contained in:
parent
dc0c1950a2
commit
1a2aa8397b
1 changed files with 10 additions and 8 deletions
|
|
@ -117,15 +117,17 @@ def read_config_file(libname):
|
||||||
None if no location is specified, otherwise a path to the library
|
None if no location is specified, otherwise a path to the library
|
||||||
"""
|
"""
|
||||||
filename = glymurrc_fname()
|
filename = glymurrc_fname()
|
||||||
if filename is not None:
|
if filename is None:
|
||||||
# Read the configuration file for the library location.
|
# There's no library file path to return in this case.
|
||||||
parser = ConfigParser()
|
return None
|
||||||
parser.read(filename)
|
|
||||||
try:
|
|
||||||
path = parser.get('library', libname)
|
|
||||||
except NoOptionError:
|
|
||||||
path = None
|
|
||||||
|
|
||||||
|
# Read the configuration file for the library location.
|
||||||
|
parser = ConfigParser()
|
||||||
|
parser.read(filename)
|
||||||
|
try:
|
||||||
|
path = parser.get('library', libname)
|
||||||
|
except NoOptionError:
|
||||||
|
path = None
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def glymur_config():
|
def glymur_config():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue