diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-11-28 17:55:18 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-11-28 17:55:18 +0100 |
| commit | aa9eb57f3d9370fc688c1f69d68c0d85efa63a01 (patch) | |
| tree | ec5f1f9670360f3d6deb60a92992b9af6e365367 /py3status | |
| parent | 4af425bf3bb23933e8aa33088f501431fe604cae (diff) | |
ensure i3status config parsed values are not evaluated as exotic objects types
Diffstat (limited to 'py3status')
| -rwxr-xr-x | py3status/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/py3status/__init__.py b/py3status/__init__.py index 059dea4..7a9bca1 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -163,9 +163,15 @@ class I3status(Thread): key = line.split('=')[0].strip() value = line.split('=')[1].strip() try: - value = eval(value) + e_value = eval(value) + if isinstance(e_value, str) or isinstance(e_value, int): + value = e_value + else: + raise ValueError() except NameError: pass + except ValueError: + pass if section_name == 'order': config[section_name].append(value) |
