Fix issue with Pypy

This commit is contained in:
Valentin Lorentz 2010-12-12 14:17:09 +01:00
parent 96ea659030
commit a58e270516
4 changed files with 8 additions and 8 deletions

View File

@ -34,7 +34,7 @@ import dynamicScope
import supybot.utils as utils
__builtins__['format'] = utils.str.format
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['format'] = utils.str.format
class Author(object):
def __init__(self, name=None, nick=None, email=None, **kwargs):

View File

@ -144,7 +144,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
self.irc.feedMsg(msg)
except socket.timeout:
pass
except ssl.SSLError as e:
except ssl.SSLError, e:
if e.args[0] == 'The read operation timed out':
pass
else:

View File

@ -47,6 +47,6 @@ class DynamicScope(object):
def __setattr__(self, name, value):
self._getLocals(name)[name] = value
__builtins__['dynamic'] = DynamicScope()
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['dynamic'] = DynamicScope()
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -54,14 +54,14 @@ def force(x):
return x()
else:
return x
__builtins__['force'] = force
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['force'] = force
if sys.version_info < (2, 4, 0):
def reversed(L):
"""Iterates through a sequence in reverse."""
for i in xrange(len(L) - 1, -1, -1):
yield L[i]
__builtins__['reversed'] = reversed
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['reversed'] = reversed
def sorted(iterable, cmp=None, key=None, reversed=False):
L = list(iterable)
@ -74,7 +74,7 @@ if sys.version_info < (2, 4, 0):
L.reverse()
return L
__builtins__['sorted'] = sorted
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['sorted'] = sorted
import operator
def itemgetter(i):
@ -86,8 +86,8 @@ if sys.version_info < (2, 4, 0):
operator.attrgetter = attrgetter
import sets
__builtins__['set'] = sets.Set
__builtins__['frozenset'] = sets.ImmutableSet
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['set'] = sets.Set
(__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['frozenset'] = sets.ImmutableSet
import socket
# Some socket modules don't have sslerror, so we'll just make it an error.