| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c5f3c58 commit e50ee0a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -117,11 +117,6 @@ def b(data): | |||
| 117 | 117 | return data.encode('latin1') | |
| 118 | 118 | return data | |
| 119 | 119 | ||
| 120 | - if PY3: | ||
| 121 | - bytes_chr = lambda code: bytes((code,)) | ||
| 122 | - else: | ||
| 123 | - bytes_chr = chr | ||
| 124 | - | ||
| 125 | 120 | def surrogateescape_handler(exc): | |
| 126 | 121 | """ | |
| 127 | 122 | Pure Python implementation of the PEP 383: the "surrogateescape" error | |
@@ -216,9 +211,9 @@ def encodefilename(fn): | |||
| 216 | 211 | for index, ch in enumerate(fn): | |
| 217 | 212 | code = ord(ch) | |
| 218 | 213 | if code < 128: | |
| 219 | - ch = bytes_chr(code) | ||
| 214 | + ch = bytes((code,)) | ||
| 220 | 215 | elif 0xDC80 <= code <= 0xDCFF: | |
| 221 | - ch = bytes_chr(code - 0xDC00) | ||
| 216 | + ch = bytes((code - 0xDC00,)) | ||
| 222 | 217 | else: | |
| 223 | 218 | raise UnicodeEncodeError(FS_ENCODING, | |
| 224 | 219 | fn, index, index+1, | |
@@ -233,7 +228,7 @@ def encodefilename(fn): | |||
| 233 | 228 | code = ord(ch) | |
| 234 | 229 | if 0xD800 <= code <= 0xDFFF: | |
| 235 | 230 | if 0xDC80 <= code <= 0xDCFF: | |
| 236 | - ch = bytes_chr(code - 0xDC00) | ||
| 231 | + ch = bytes((code - 0xDC00,)) | ||
| 237 | 232 | encoded.append(ch) | |
| 238 | 233 | else: | |
| 239 | 234 | raise UnicodeEncodeError( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments