mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	Fix byte format() on Python 3.
This commit is contained in:
		@@ -211,10 +211,9 @@ class MagicEncode(object):
 | 
				
			|||||||
        # is different, emit a change command.
 | 
					        # is different, emit a change command.
 | 
				
			||||||
        if encoding != self.encoding:
 | 
					        if encoding != self.encoding:
 | 
				
			||||||
            self.encoding = encoding
 | 
					            self.encoding = encoding
 | 
				
			||||||
            self.driver._raw(b'{}{}'.format(
 | 
					            self.driver._raw(
 | 
				
			||||||
                CODEPAGE_CHANGE,
 | 
					                CODEPAGE_CHANGE +
 | 
				
			||||||
                six.int2byte(self.encoder.get_sequence(encoding))
 | 
					                six.int2byte(self.encoder.get_sequence(encoding)))
 | 
				
			||||||
            ))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if text:
 | 
					        if text:
 | 
				
			||||||
            self.driver._raw(CodePages.encode(text, encoding, errors="replace"))
 | 
					            self.driver._raw(CodePages.encode(text, encoding, errors="replace"))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user