More misc. Python3 cleanup.

This commit is contained in:
Ryan Petrello
2013-05-01 07:40:20 -04:00
parent d2fa520583
commit 6024886115
2 changed files with 2 additions and 5 deletions

View File

@@ -125,9 +125,6 @@ class ShellCommand(BaseCommand):
locs['model'] = model
# insert the pecan locals
exec(
'from pecan import abort, conf, redirect, request, response'
) in locs
from pecan import abort, conf, redirect, request, response
locs['abort'] = abort
locs['conf'] = conf

View File

@@ -120,7 +120,7 @@ class Config(object):
self.__values__[key] = ConfigDict(value)
else:
self.__values__[key] = Config(value, filename=self.__file__)
elif isinstance(value, str) and '%(confdir)s' in value:
elif isinstance(value, six.string_types) and '%(confdir)s' in value:
confdir = os.path.dirname(self.__file__) or os.getcwd()
self.__values__[key] = value.replace('%(confdir)s', confdir)
else:
@@ -221,7 +221,7 @@ def set_config(config, overwrite=False):
if overwrite is True:
_runtime_conf.empty()
if isinstance(config, str):
if isinstance(config, six.string_types):
config = conf_from_file(config)
_runtime_conf.update(config)
if config.__file__: