Skip to content

Commit

Permalink
Drop compatibility wrapper for SEEK_END and SEEK_CUR.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Dec 3, 2013
1 parent 7c5b770 commit f93d42b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
11 changes: 2 additions & 9 deletions dulwich/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions dulwich/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions dulwich/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f93d42b

Please sign in to comment.