summaryrefslogtreecommitdiff
path: root/src/theming.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-20 23:32:56 +0100
committermathieui <mathieui@mathieui.net>2014-12-20 23:32:56 +0100
commit3c195dd9ccef1adbb59ad8db7fcc7086fd01b667 (patch)
treef80f790330f87b98dcae066d45228f0f49306db4 /src/theming.py
parent2452706b909364178655c6c918a0348fb4298fb2 (diff)
downloadpoezio-3c195dd9ccef1adbb59ad8db7fcc7086fd01b667.tar.gz
poezio-3c195dd9ccef1adbb59ad8db7fcc7086fd01b667.tar.bz2
poezio-3c195dd9ccef1adbb59ad8db7fcc7086fd01b667.tar.xz
poezio-3c195dd9ccef1adbb59ad8db7fcc7086fd01b667.zip
Remove the remaining pre-3.4 compatibility hacks
Diffstat (limited to 'src/theming.py')
-rwxr-xr-xsrc/theming.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/theming.py b/src/theming.py
index 3ca1a89f..ecbff5a5 100755
--- a/src/theming.py
+++ b/src/theming.py
@@ -69,14 +69,11 @@ log = logging.getLogger(__name__)
from config import config
import curses
-import imp
import os
from os import path
-from sys import version_info
-if version_info[1] >= 3:
- from importlib import machinery
- finder = machinery.PathFinder()
+from importlib import machinery
+finder = machinery.PathFinder()
class Theme(object):
"""
@@ -500,21 +497,13 @@ def reload_theme():
new_theme = None
exc = None
try:
- if version_info[1] < 3:
- file, filename, info = imp.find_module(theme_name, load_path)
- imp.acquire_lock()
- new_theme = imp.load_module(theme_name, file, filename, info)
- else:
- loader = finder.find_module(theme_name, load_path)
- if not loader:
- return 'Failed to load the theme %s' % theme_name
- new_theme = loader.load_module()
+ loader = finder.find_module(theme_name, load_path)
+ if not loader:
+ return 'Failed to load the theme %s' % theme_name
+ new_theme = loader.load_module()
except Exception as e:
log.error('Failed to load the theme %s', theme_name, exc_info=True)
exc = e
- finally:
- if version_info[1] < 3 and imp.lock_held():
- imp.release_lock()
if not new_theme:
return 'Failed to load theme: %s' % exc