File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -117,11 +117,6 @@ def b(data):
117117 return data .encode ('latin1' )
118118 return data
119119
120- if PY3 :
121- bytes_chr = lambda code : bytes ((code ,))
122- else :
123- bytes_chr = chr
124-
125120def surrogateescape_handler (exc ):
126121 """
127122 Pure Python implementation of the PEP 383: the "surrogateescape" error
@@ -216,9 +211,9 @@ def encodefilename(fn):
216211 for index , ch in enumerate (fn ):
217212 code = ord (ch )
218213 if code < 128 :
219- ch = bytes_chr ( code )
214+ ch = bytes (( code ,) )
220215 elif 0xDC80 <= code <= 0xDCFF :
221- ch = bytes_chr ( code - 0xDC00 )
216+ ch = bytes (( code - 0xDC00 ,) )
222217 else :
223218 raise UnicodeEncodeError (FS_ENCODING ,
224219 fn , index , index + 1 ,
@@ -233,7 +228,7 @@ def encodefilename(fn):
233228 code = ord (ch )
234229 if 0xD800 <= code <= 0xDFFF :
235230 if 0xDC80 <= code <= 0xDCFF :
236- ch = bytes_chr ( code - 0xDC00 )
231+ ch = bytes (( code - 0xDC00 ,) )
237232 encoded .append (ch )
238233 else :
239234 raise UnicodeEncodeError (
You can’t perform that action at this time.
0 commit comments