@@ -120,7 +120,7 @@ def dump(self, obj):
120120 self .writeObject (obj )
121121 return self .object_stream .getvalue ()
122122
123- def _writeStreamHeader (self ):
123+ def _writeStreamHeader (self ): # pylint:disable=C0103
124124 """
125125 Writes the Java serialization magic header in the serialization stream
126126 """
@@ -130,7 +130,7 @@ def _writeStreamHeader(self):
130130 (StreamConstants .STREAM_MAGIC , StreamConstants .STREAM_VERSION ),
131131 )
132132
133- def writeObject (self , obj ):
133+ def writeObject (self , obj ): # pylint:disable=C0103
134134 """
135135 Appends an object to the serialization stream
136136
@@ -156,7 +156,7 @@ def writeObject(self, obj):
156156 elif obj is None :
157157 # Null
158158 self .write_null ()
159- elif type (obj ) is str :
159+ elif type (obj ) is str : # pylint:disable=C0123
160160 # String value
161161 self .write_blockdata (obj )
162162 else :
@@ -166,7 +166,7 @@ def writeObject(self, obj):
166166 "supported." .format (type (obj ))
167167 )
168168
169- def _writeStruct (self , unpack , length , args ):
169+ def _writeStruct (self , unpack , length , args ): # pylint:disable=C0103
170170 """
171171 Appends data to the serialization stream
172172
@@ -177,7 +177,7 @@ def _writeStruct(self, unpack, length, args):
177177 ba = struct .pack (unpack , * args )
178178 self .object_stream .write (ba )
179179
180- def _writeString (self , obj , use_reference = True ):
180+ def _writeString (self , obj , use_reference = True ): # pylint:disable=C0103
181181 """
182182 Appends a string to the serialization stream
183183
@@ -270,7 +270,7 @@ def write_enum(self, obj):
270270
271271 self .write_string (obj .constant )
272272
273- def write_blockdata (self , obj , parent = None ):
273+ def write_blockdata (self , obj , parent = None ): # pylint:disable=W0613
274274 """
275275 Appends a block of data to the serialization stream
276276
@@ -374,7 +374,7 @@ def write_object(self, obj, parent=None):
374374 self .writeObject (annotation )
375375 self ._writeStruct (">B" , 1 , (TerminalCode .TC_ENDBLOCKDATA ,))
376376
377- def write_class (self , obj , parent = None ):
377+ def write_class (self , obj , parent = None ): # pylint:disable=W0613
378378 """
379379 Writes a class to the stream
380380
@@ -384,7 +384,7 @@ def write_class(self, obj, parent=None):
384384 self ._writeStruct (">B" , 1 , (TerminalCode .TC_CLASS ,))
385385 self .write_classdesc (obj )
386386
387- def write_classdesc (self , obj , parent = None ):
387+ def write_classdesc (self , obj , parent = None ): # pylint:disable=W0613
388388 """
389389 Writes a class description
390390
@@ -553,9 +553,11 @@ def _convert_type_to_char(type_char):
553553 """
554554 if isinstance (type_char , TypeCode ):
555555 return type_char .value
556- elif isinstance (type_char , int ):
556+
557+ if isinstance (type_char , int ):
557558 return type_char
558- elif isinstance (type_char , (BYTES_TYPE , UNICODE_TYPE )):
559+
560+ if isinstance (type_char , (BYTES_TYPE , UNICODE_TYPE )):
559561 # Conversion to TypeCode will raise an error if the type
560562 # is invalid
561563 return TypeCode (ord (type_char [0 ])).value
0 commit comments