Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite50ee0a

Browse files
Harmon758Byron
authored andcommitted
Remove and replace compat.bytes_chr
1 parentc5f3c58 commite50ee0a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

‎git/compat.py‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ def b(data):
117117
returndata.encode('latin1')
118118
returndata
119119

120-
ifPY3:
121-
bytes_chr=lambdacode:bytes((code,))
122-
else:
123-
bytes_chr=chr
124-
125120
defsurrogateescape_handler(exc):
126121
"""
127122
Pure Python implementation of the PEP 383: the "surrogateescape" error
@@ -216,9 +211,9 @@ def encodefilename(fn):
216211
forindex,chinenumerate(fn):
217212
code=ord(ch)
218213
ifcode<128:
219-
ch=bytes_chr(code)
214+
ch=bytes((code,))
220215
elif0xDC80<=code<=0xDCFF:
221-
ch=bytes_chr(code-0xDC00)
216+
ch=bytes((code-0xDC00,))
222217
else:
223218
raiseUnicodeEncodeError(FS_ENCODING,
224219
fn,index,index+1,
@@ -233,7 +228,7 @@ def encodefilename(fn):
233228
code=ord(ch)
234229
if0xD800<=code<=0xDFFF:
235230
if0xDC80<=code<=0xDCFF:
236-
ch=bytes_chr(code-0xDC00)
231+
ch=bytes((code-0xDC00,))
237232
encoded.append(ch)
238233
else:
239234
raiseUnicodeEncodeError(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp