summaryrefslogtreecommitdiffstats
path: root/pyload/utils
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-01 23:53:07 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-01 23:53:07 +0100
commit004a80bfaad38f9400e8aebcb8f980353a232295 (patch)
tree1e786d2d14a3040767aac237982544b74a9567cb /pyload/utils
parentFix previous merge (diff)
downloadpyload-004a80bfaad38f9400e8aebcb8f980353a232295.tar.xz
PEP-8, Python Zen, refactor and reduce code (thx FedeG)
Diffstat (limited to 'pyload/utils')
-rw-r--r--pyload/utils/JsEngine.py6
-rw-r--r--pyload/utils/__init__.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/pyload/utils/JsEngine.py b/pyload/utils/JsEngine.py
index f6f28f457..c516dfc73 100644
--- a/pyload/utils/JsEngine.py
+++ b/pyload/utils/JsEngine.py
@@ -9,7 +9,7 @@ from urllib import quote
from pyload.utils import encode, decode, uniqify
-class JsEngine:
+class JsEngine(object):
""" JS Engine superclass """
def __init__(self, core, engine=None): #: engine can be a jse name """string""" or an AbstractEngine """class"""
@@ -103,7 +103,7 @@ class JsEngine:
return results[0]
-class AbstractEngine:
+class AbstractEngine(object):
""" JSE base class """
NAME = ""
@@ -123,7 +123,7 @@ class AbstractEngine:
except ImportError:
try:
out, err = cls().eval("print(23+19)")
- except:
+ except Exception:
res = False
else:
res = out == "42"
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index 541dedbd8..1c398224f 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -23,7 +23,7 @@ json_dumps = json.dumps
def chmod(*args):
try:
os.chmod(*args)
- except:
+ except Exception:
pass
@@ -53,7 +53,7 @@ def remove_chars(string, repl):
if type(string) == str:
return string.translate(maketrans("", ""), repl)
elif type(string) == unicode:
- return string.translate(dict([(ord(s), None) for s in repl]))
+ return string.translate(dict((ord(s), None) for s in repl))
def safe_filename(name):