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

Commit438d3e6

Browse files
Harmon758Byron
authored andcommitted
Remove and replace compat.FileType
1 parentd01f072 commit438d3e6

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

‎git/compat.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
defenc=sys.getfilesystemencoding()
3434

3535
ifPY3:
36-
importio
37-
FileType=io.IOBase
38-
3936
defbyte_ord(b):
4037
returnb
4138

@@ -49,9 +46,6 @@ def mviter(d):
4946
unicode=str
5047
binary_type=bytes
5148
else:
52-
FileType=file# @UndefinedVariable on PY3
53-
# usually, this is just ascii, which might not enough for our encoding needs
54-
# Unless it's set specifically, we override it to be utf-8
5549
ifdefenc=='ascii':
5650
defenc='utf-8'
5751
byte_ord=ord

‎git/config.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
importabc
1010
fromfunctoolsimportwraps
1111
importinspect
12+
fromioimportIOBase
1213
importlogging
1314
importos
1415
importre
1516
fromcollectionsimportOrderedDict
1617

1718
fromgit.compatimport (
1819
string_types,
19-
FileType,
2020
defenc,
2121
force_text,
2222
with_metaclass,
@@ -581,7 +581,7 @@ def write(self):
581581
fp=self._file_or_files
582582

583583
# we have a physical file on disk, so get a lock
584-
is_file_lock=isinstance(fp,string_types+ (FileType, ))
584+
is_file_lock=isinstance(fp,string_types+ (IOBase, ))
585585
ifis_file_lock:
586586
self._lock._obtain_lock()
587587
ifnothasattr(fp,"seek"):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp