summaryrefslogtreecommitdiff
path: root/eventlet
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2014-04-23 13:29:17 +0400
committerSergey Shepelev <temotor@gmail.com>2014-04-23 15:15:22 +0400
commit2da62a16c392898623449bd53413ce804b4cb413 (patch)
tree4b0ec6ff43dc91e5c0b1df67a590e1c261b69e86 /eventlet
parent1b9f0f0edb285be01bc570b1f64ee2aa2cba49db (diff)
downloadeventlet-2da62a16c392898623449bd53413ce804b4cb413.tar.gz
PEP-8 fixes, tox runs pep8 check
For now, pep8 check is only run for some files known to be clean, we should clean the rest and enable pep8 check for all files then.
Diffstat (limited to 'eventlet')
-rw-r--r--eventlet/api.py4
-rw-r--r--eventlet/green/MySQLdb.py8
-rw-r--r--eventlet/support/stacklesss.py2
3 files changed, 9 insertions, 5 deletions
diff --git a/eventlet/api.py b/eventlet/api.py
index 3745b96..b266b51 100644
--- a/eventlet/api.py
+++ b/eventlet/api.py
@@ -122,8 +122,8 @@ class timeout(object):
Example::
- with timeout(10):
- urllib2.open('http://example.com')
+ with timeout(10):
+ urllib2.open('http://example.com')
Assuming code block is yielding (i.e. gives up control to the hub),
an exception provided in *exc* argument will be raised
diff --git a/eventlet/green/MySQLdb.py b/eventlet/green/MySQLdb.py
index 1ac59b1..3593542 100644
--- a/eventlet/green/MySQLdb.py
+++ b/eventlet/green/MySQLdb.py
@@ -4,21 +4,25 @@ __all__ = __MySQLdb.__all__
__patched__ = ["connect", "Connect", 'Connection', 'connections']
from eventlet.patcher import slurp_properties
-slurp_properties(__MySQLdb, globals(),
+slurp_properties(
+ __MySQLdb, globals(),
ignore=__patched__, srckeys=dir(__MySQLdb))
-
+
from eventlet import tpool
__orig_connections = __import__('MySQLdb.connections').connections
+
def Connection(*args, **kw):
conn = tpool.execute(__orig_connections.Connection, *args, **kw)
return tpool.Proxy(conn, autowrap_names=('cursor',))
connect = Connect = Connection
+
# replicate the MySQLdb.connections module but with a tpooled Connection factory
class MySQLdbConnectionsModule(object):
pass
+
connections = MySQLdbConnectionsModule()
for var in dir(__orig_connections):
if not var.startswith('__'):
diff --git a/eventlet/support/stacklesss.py b/eventlet/support/stacklesss.py
index e93a932..509299c 100644
--- a/eventlet/support/stacklesss.py
+++ b/eventlet/support/stacklesss.py
@@ -80,5 +80,5 @@ def emulate():
main_coro = greenlet()
tasklet_to_greenlet[caller] = main_coro
main_coro.t = caller
- del main_coro.switch ## It's already running
+ del main_coro.switch # It's already running
coro_args[main_coro] = None