mirror of https://github.com/Shizmob/pydle.git
Fix import errors more elegantly.
This commit is contained in:
parent
b76967dc77
commit
b37c2b39ea
|
@ -1,18 +1,15 @@
|
|||
import os
|
||||
|
||||
__name__ = 'pydle'
|
||||
__version__ = '0.8.0'
|
||||
__version_info__ = (0, 8, 0)
|
||||
__license__ = '3-clause BSD'
|
||||
|
||||
|
||||
if os.environ.get('READTHEDOCS', None) != 'True':
|
||||
from . import async, connection, protocol, client, features
|
||||
|
||||
from .async import coroutine, Future
|
||||
from .client import Error, NotInChannel, AlreadyInChannel, BasicClient, ClientPool
|
||||
from .features.ircv3_1.cap import NEGOTIATING as CAPABILITY_NEGOTIATING, FAILED as CAPABILITY_FAILED, NEGOTIATED as CAPABILITY_NEGOTIATED
|
||||
|
||||
__name__ = 'pydle'
|
||||
__version__ = '0.8.0'
|
||||
__version_info__ = (0, 8, 0)
|
||||
__license__ = 'BSD'
|
||||
|
||||
|
||||
def featurize(*features):
|
||||
""" Put features into proper MRO order. """
|
||||
from functools import cmp_to_key
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
## async.py
|
||||
# Light wrapper around whatever async library pydle uses.
|
||||
import os
|
||||
import functools
|
||||
import itertools
|
||||
import collections
|
||||
|
@ -7,8 +8,24 @@ import threading
|
|||
import datetime
|
||||
import types
|
||||
|
||||
try:
|
||||
import tornado.concurrent
|
||||
import tornado.ioloop
|
||||
except ImportError:
|
||||
if os.environ.get('READTHEDOCS', None) == 'True':
|
||||
# Shim some objects for RTD.
|
||||
class tornado:
|
||||
class concurrent:
|
||||
class TracebackFuture:
|
||||
pass
|
||||
|
||||
class ioloop:
|
||||
class IOLoop:
|
||||
READ = 1
|
||||
WRITE = 2
|
||||
ERROR = 3
|
||||
else:
|
||||
raise
|
||||
|
||||
FUTURE_TIMEOUT = 30
|
||||
|
||||
|
|
Loading…
Reference in New Issue