Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork178
Change import statements to import only what's needed#468
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
3863b43
5e4efd7
a40fe76
b92866f
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5,10 +5,11 @@ | ||
import argparse | ||
import asyncio | ||
importasyncio.test_utils | ||
import json | ||
import logging | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Imports should be sorted alphabetically (that's what we try to do in asyncio and CPython code bases). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @1st1 I wasn't aware of that, sorry. I was going by the PEP8 guidelines, where it tells us to import the standard library modules first. But I'll have that fix following your recommendations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @denisra Asyncio is technically a stdlib module. ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @SethMichaelLarson I can't say that it isn't :) will send send in another commit in just a few min with that fixed | ||
ARGS = argparse.ArgumentParser(description='Cache client example.') | ||
ARGS.add_argument( | ||
'--tls', action='store_true', dest='tls', | ||
@@ -106,7 +107,7 @@ def activity(self): | ||
self.reader, self.writer = yield from asyncio.open_connection( | ||
self.host, self.port, ssl=self.sslctx, loop=self.loop) | ||
except Exception as exc: | ||
backoff = min(args.max_backoff, backoff + (backoff //2) + 1) | ||
logging.info('Error connecting: %r; sleep %s', exc, backoff) | ||
yield from asyncio.sleep(backoff, loop=self.loop) | ||
continue | ||
@@ -191,7 +192,7 @@ def w(g): | ||
key = 'foo-%s' % label | ||
while True: | ||
logging.info('%s %s', label, '-' *20) | ||
try: | ||
ret = yield from w(cache.set(key, 'hello-%s-world' % label)) | ||
logging.info('%s set %s', label, ret) | ||
Uh oh!
There was an error while loading.Please reload this page.