From f93d42b8e6d7617ec48ab4995e9e2ae8bd3b0eb2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Dec 2013 01:12:25 +0000 Subject: [PATCH] Drop compatibility wrapper for `SEEK_END` and `SEEK_CUR`. --- dulwich/_compat.py | 11 ++--------- dulwich/pack.py | 8 ++++---- dulwich/protocol.py | 6 +++--- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/dulwich/_compat.py b/dulwich/_compat.py index d30913f6e..d587da6d8 100644 --- a/dulwich/_compat.py +++ b/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 diff --git a/dulwich/pack.py b/dulwich/pack.py index 12232e67b..ff78af75d 100644 --- a/dulwich/pack.py +++ b/dulwich/pack.py @@ -53,6 +53,10 @@ 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.lru_cache import ( LRUSizeCache, ) -from dulwich._compat import ( - SEEK_CUR, - SEEK_END, - ) from dulwich.objects import ( ShaFile, hex_to_sha, diff --git a/dulwich/protocol.py b/dulwich/protocol.py index b7e0298c0..e0f2928a8 100644 --- a/dulwich/protocol.py +++ b/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