Skip to content

Commit

Permalink
Merge jelly-require-unicode-7667
Browse files Browse the repository at this point in the history
Author: wolfgang61
Reviewer: exarkun
Fixes: twisted#7667

Remove the pointless Python-without-unicode support code from
`twisted.spread.jelly`.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@43237 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
exarkun committed Oct 5, 2014
1 parent 7b6f54e commit 8b555a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions twisted/spread/jelly.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import decimal
from functools import reduce
from types import StringType
from types import UnicodeType
from types import IntType
from types import TupleType
from types import ListType
Expand Down Expand Up @@ -98,6 +97,7 @@
from zope.interface import implementer

# Twisted Imports
from twisted.python.compat import unicode
from twisted.python.reflect import namedObject, qual
from twisted.persisted.crefutil import NotKnown, _Tuple, _InstanceMethod
from twisted.persisted.crefutil import _DictKeyAndValue, _Dereference
Expand Down Expand Up @@ -475,7 +475,7 @@ def jelly(self, obj):
self.jelly(obj.im_self),
self.jelly(obj.im_class)]

elif UnicodeType and objType is UnicodeType:
elif objType is unicode:
return ['unicode', obj.encode('UTF-8')]
elif objType is NoneType:
return ['None']
Expand Down Expand Up @@ -679,10 +679,7 @@ def _unjelly_None(self, exp):


def _unjelly_unicode(self, exp):
if UnicodeType:
return unicode(exp[0], "UTF-8")
else:
return Unpersistable("Could not unpersist unicode: %s" % (exp[0],))
return unicode(exp[0], "UTF-8")


def _unjelly_decimal(self, exp):
Expand Down Expand Up @@ -1013,8 +1010,7 @@ def __init__(self):
"date": 1,
"timedelta": 1,
"NoneType": 1}
if hasattr(types, 'UnicodeType'):
self.allowedTypes['unicode'] = 1
self.allowedTypes['unicode'] = 1
self.allowedTypes['decimal'] = 1
self.allowedTypes['set'] = 1
self.allowedTypes['frozenset'] = 1
Expand Down
Empty file added twisted/topfiles/7667.misc
Empty file.

0 comments on commit 8b555a6

Please sign in to comment.