Skip to content

Commit

Permalink
Merge branch 'stable' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Jun 27, 2017
2 parents 0dc2949 + 55016fb commit e3fd034
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pwnlib/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,9 +1359,14 @@ def update_context_defaults(section):
if key not in ContextType.defaults:
log.warn("Unknown configuration option %r in section %r" % (key, 'context'))
continue
if isinstance(ContextType.defaults[key], (str, unicode, tuple)):

default = ContextType.defaults[key]

if isinstance(default, (str, unicode, tuple, int, long, list, dict)):
value = safeeval.expr(value)
else:
log.warn("Unsupported configuration option %r in section %r" % (key, 'context'))

ContextType.defaults[key] = value
ContextType.defaults[key] = type(default)(value)

register_config('context', update_context_defaults)

0 comments on commit e3fd034

Please sign in to comment.