Przeglądaj źródła

Drop compatibility wrapper for `SEEK_END` and `SEEK_CUR`.

Jelmer Vernooij 11 lat temu
rodzic
commit
f93d42b8e6
3 zmienionych plików z 9 dodań i 16 usunięć
  1. 2 9
      dulwich/_compat.py
  2. 4 4
      dulwich/pack.py
  3. 3 3
      dulwich/protocol.py

+ 2 - 9
dulwich/_compat.py

@@ -16,19 +16,12 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA  02110-1301, USA.
 
-"""Misc utilities to work with python <2.6.
+"""Misc utilities to work with python <2.7.
 
 These utilities can all be deleted when dulwich decides it wants to stop
-support for python <2.6.
+support for python <2.7.
 """
 
-try:
-    from os import SEEK_CUR, SEEK_END
-except ImportError:
-    SEEK_CUR = 1
-    SEEK_END = 2
-
-
 # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
 # Passes Python2.7's test suite and incorporates all the latest updates.
 # Copyright (C) Raymond Hettinger, MIT license

+ 4 - 4
dulwich/pack.py

@@ -53,6 +53,10 @@ else:
     has_mmap = True
 from hashlib import sha1
 import os
+from os import (
+    SEEK_CUR,
+    SEEK_END,
+    )
 import struct
 from struct import unpack_from
 import sys
@@ -67,10 +71,6 @@ from dulwich.file import GitFile
 from dulwich.lru_cache import (
     LRUSizeCache,
     )
-from dulwich._compat import (
-    SEEK_CUR,
-    SEEK_END,
-    )
 from dulwich.objects import (
     ShaFile,
     hex_to_sha,

+ 3 - 3
dulwich/protocol.py

@@ -20,15 +20,15 @@
 """Generic functions for talking the git smart server protocol."""
 
 from cStringIO import StringIO
+from os import (
+    SEEK_END,
+    )
 import socket
 
 from dulwich.errors import (
     HangupException,
     GitProtocolError,
     )
-from dulwich._compat import (
-    SEEK_END,
-    )
 
 TCP_GIT_PORT = 9418