Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
micro = int(match.group('micro'))
levels = {'c': 'candidate',
'a': 'alpha',
'b': 'beta',
None: 'final'}
releaselevel = levels[match.group('releaselevel')]
serial = int(match.group('serial')) if match.group('serial') else 0
return VersionInfo(major, minor, micro, releaselevel, serial)
except Exception:
raise ImportError("Invalid package version {}".format(ver))
version_info = _parse_version(__version__)
# make pyflakes happy
(connect, create_pool, Connection, Cursor, Pool, DEFAULT_TIMEOUT,
IsolationLevel, Transaction)
def get_connection(dsn):
pool = pools.get(dsn, None)
if pool is None:
pool = pools[dsn] = yield from create_pool(dsn)
conn = yield from pool
return conn
def create_pool(dsn=None, *, minsize=10, maxsize=10,
loop=None, **kwargs):
return (yield from base_create_pool(dsn,
minsize=minsize,
maxsize=maxsize,
loop=loop,
_connection_factory=SAConnection,
**kwargs))