@@ -23,12 +23,12 @@ def safe_ref(target, on_delete=None): # pragma: no cover
2323 goes out of scope with the reference object, (either a
2424 :class:`weakref.ref` or a :class:`BoundMethodWeakref`) as argument.
2525 """
26- if getattr (target , " im_self" , None ) is not None :
26+ if getattr (target , ' im_self' , None ) is not None :
2727 # Turn a bound method into a BoundMethodWeakref instance.
2828 # Keep track of these instances for lookup by disconnect().
2929 assert hasattr (target , 'im_func' ), \
30- """safe_ref target {0!r} has im_self, but no im_func, " \
31- " don't know how to create reference""" .format (target )
30+ """safe_ref target {0!r} has im_self, but no im_func: \
31+ don't know how to create reference""" .format (target )
3232 return get_bound_method_weakref (target = target ,
3333 on_delete = on_delete )
3434 if callable (on_delete ):
@@ -142,8 +142,8 @@ def remove(weak, self=self):
142142 try :
143143 traceback .print_exc ()
144144 except AttributeError :
145- print (" Exception during saferef {0} cleanup function "
146- " {1}: {2}" .format (self , function , exc ))
145+ print (' Exception during saferef {0} cleanup function '
146+ ' {1}: {2}' .format (self , function , exc ))
147147
148148 self .deletion_methods = [on_delete ]
149149 self .key = self .calculate_key (target )
@@ -163,7 +163,7 @@ def calculate_key(cls, target):
163163
164164 def __str__ (self ):
165165 """Give a friendly representation of the object"""
166- return """ {0}( {1}.{2} )""" .format (
166+ return ' {0}( {1}.{2} )' .format (
167167 type (self ).__name__ ,
168168 self .self_name ,
169169 self .func_name ,
@@ -212,7 +212,7 @@ class BoundNonDescriptorMethodWeakref(BoundMethodWeakref): # pragma: no cover
212212 ... pass
213213
214214 >>> def foo(self):
215- ... return " foo"
215+ ... return ' foo'
216216 >>> A.bar = foo
217217
218218 But this shouldn't be a common use case. So, on platforms where methods
0 commit comments