Commit bc7a7deb authored by Jason Madden's avatar Jason Madden

pylint

parent 21837b80
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
from functools import wraps from functools import wraps
def wrap_error_fatal(method): def wrap_error_fatal(method):
import gevent import gevent
SYSTEM_ERROR = gevent.get_hub().SYSTEM_ERROR system_error = gevent.get_hub().SYSTEM_ERROR
@wraps(method) @wraps(method)
def wrapper(self, *args, **kwargs): def wrapper(self, *args, **kwargs):
# XXX should also be able to do gevent.SYSTEM_ERROR = object # XXX should also be able to do gevent.SYSTEM_ERROR = object
...@@ -32,13 +34,14 @@ def wrap_error_fatal(method): ...@@ -32,13 +34,14 @@ def wrap_error_fatal(method):
try: try:
return method(self, *args, **kwargs) return method(self, *args, **kwargs)
finally: finally:
gevent.get_hub().SYSTEM_ERROR = SYSTEM_ERROR gevent.get_hub().SYSTEM_ERROR = system_error
return wrapper return wrapper
def wrap_restore_handle_error(method): def wrap_restore_handle_error(method):
import gevent import gevent
old = gevent.get_hub().handle_error old = gevent.get_hub().handle_error
@wraps(method) @wraps(method)
def wrapper(self, *args, **kwargs): def wrapper(self, *args, **kwargs):
try: try:
......
...@@ -18,9 +18,11 @@ ...@@ -18,9 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import sys
import gc import gc
import collections import collections
import types import types
from functools import wraps
import gevent.core import gevent.core
...@@ -68,7 +70,7 @@ def wrap_refcount(method): ...@@ -68,7 +70,7 @@ def wrap_refcount(method):
return diff return diff
@wraps(method) @wraps(method)
def wrapper(self, *args, **kwargs): def wrapper(self, *args, **kwargs): # pylint:disable=too-many-branches
gc.collect() gc.collect()
gc.collect() gc.collect()
gc.collect() gc.collect()
......
import sys import sys
# pylint:disable=unused-argument,import-error
PY3 = sys.version_info[0] >= 3 PY3 = sys.version_info[0] >= 3
...@@ -18,7 +19,7 @@ if PY3: ...@@ -18,7 +19,7 @@ if PY3:
raise value raise value
xrange = range xrange = range
string_types = str, string_types = (str,)
text_type = str text_type = str
else: else:
...@@ -36,7 +37,7 @@ else: ...@@ -36,7 +37,7 @@ else:
import __builtin__ as builtins import __builtin__ as builtins
xrange = builtins.xrange xrange = builtins.xrange
string_types = builtins.basestring, string_types = (builtins.basestring,)
text_type = builtins.unicode text_type = builtins.unicode
exec_("""def reraise(tp, value, tb=None): exec_("""def reraise(tp, value, tb=None):
......
...@@ -23,12 +23,15 @@ import unittest ...@@ -23,12 +23,15 @@ import unittest
from greentest import sysinfo from greentest import sysinfo
def _do_not_skip(reason): def _do_not_skip(reason):
assert reason assert reason
def dec(f): def dec(f):
return f return f
return dec return dec
if sysinfo.WIN: if sysinfo.WIN:
skipOnWindows = unittest.skip skipOnWindows = unittest.skip
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment