diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-06-06 16:49:19 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-06-06 16:49:19 -0400 |
commit | 775d606ceb5da6244d9a6abda9e7ebfe36e3d0ab (patch) | |
tree | f39e1a818e04d33191f6b3b6c8d4f5bf3b3b0542 /cherrypy/lib/reprconf.py | |
parent | cc48453dec5f40bcd755a972aec140a840b96fdf (diff) | |
download | cherrypy-git-775d606ceb5da6244d9a6abda9e7ebfe36e3d0ab.tar.gz |
Use always_iterable to re-use a proven function for the pattern of accepting None, iterable of strings, or single string for a parameter.
Diffstat (limited to 'cherrypy/lib/reprconf.py')
-rw-r--r-- | cherrypy/lib/reprconf.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cherrypy/lib/reprconf.py b/cherrypy/lib/reprconf.py index 8af1f777..7e8cb936 100644 --- a/cherrypy/lib/reprconf.py +++ b/cherrypy/lib/reprconf.py @@ -44,6 +44,8 @@ except ImportError: import operator as _operator import sys +from jaraco.itertools import always_iterable + def as_dict(config): """Return a dict from 'config' whether it is a dict, file, or filename.""" @@ -192,9 +194,7 @@ class Parser(ConfigParser): return optionstr def read(self, filenames): - if isinstance(filenames, basestring): - filenames = [filenames] - for filename in filenames: + for filename in always_iterable(filenames): # try: # fp = open(filename) # except IOError: |