Skip to content

Commit 60ada21

Browse files
committed
Upgrade to Python 3.5+ only again as py-ipfs-http-client doesn't support 2.7 anymore
1 parent 3183161 commit 60ada21

25 files changed

+60
-173
lines changed

.travis.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
sudo: false
21
language: python
32
matrix:
43
include:
54
- python: 3.6
65
env: TOXENV=lint
7-
- python: 2.7
8-
env: TOXENV=py27
9-
- python: 3.4
10-
env: TOXENV=py34
116
- python: 3.5
127
env: TOXENV=py35
138
- python: 3.6
149
env: TOXENV=py36
1510
- python: 3.7
1611
env: TOXENV=py37
17-
dist: xenial
12+
- python: 3.8
13+
env: TOXENV=py38
1814
- python: pypy3.5
1915
env: TOXENV=pypy3
20-
allow_failures:
21-
- python: 2.7
22-
env: TOXENV=py27
2316

2417
install:
2518
- pip install tox

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Steven Buss <[email protected]>
22
Fred Thomsen <[email protected]>
33
Jesse Weinstein <[email protected]>
4+
Alexander Schlarb <[email protected]>

LICENSE-MIT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2014-2015 Steven Buss
4+
Copyright (c) 2019-2020 Alexander Schlarb
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

multiaddr/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
from .multiaddr import Multiaddr # NOQA
32

43
__author__ = 'Steven Buss'

multiaddr/codecs/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- encoding: utf-8 -*-
2-
from __future__ import absolute_import
31
import importlib
42

53

multiaddr/codecs/_util.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

multiaddr/codecs/domain.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
import idna
42

53
from . import LENGTH_PREFIXED_VAR_SIZE

multiaddr/codecs/fspath.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
1-
from __future__ import absolute_import
21
import os
32

4-
import six
5-
63
from . import LENGTH_PREFIXED_VAR_SIZE
74

85

96
SIZE = LENGTH_PREFIXED_VAR_SIZE
107
IS_PATH = True
118

129

13-
if hasattr(os, "fsencode") and hasattr(os, "fsdecode"):
14-
fsencode = os.fsencode
15-
fsdecode = os.fsdecode
16-
else: # pragma: no cover (PY2)
17-
import sys
18-
19-
def fsencode(path):
20-
if not isinstance(path, six.binary_type):
21-
path = path.encode(sys.getfilesystemencoding())
22-
return path
23-
24-
def fsdecode(path):
25-
if not isinstance(path, six.text_type):
26-
path = path.decode(sys.getfilesystemencoding())
27-
return path
28-
29-
3010
def to_bytes(proto, string):
31-
return fsencode(string)
11+
return os.fsencode(string)
3212

3313

3414
def to_string(proto, buf):
35-
return fsdecode(buf)
15+
return os.fsdecode(buf)

multiaddr/codecs/ip4.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
from __future__ import absolute_import
2-
31
import netaddr
4-
import six
5-
6-
from ._util import packed_net_bytes_to_int
72

83

94
SIZE = 32
@@ -15,5 +10,4 @@ def to_bytes(proto, string):
1510

1611

1712
def to_string(proto, buf):
18-
ip_addr = netaddr.IPAddress(packed_net_bytes_to_int(buf), version=4)
19-
return six.text_type(ip_addr)
13+
return str(netaddr.IPAddress(int.from_bytes(buf, byteorder='big'), version=4))

multiaddr/codecs/ip6.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
from __future__ import absolute_import
2-
31
import netaddr
4-
import six
5-
6-
from ._util import packed_net_bytes_to_int
72

83

94
SIZE = 128
@@ -15,5 +10,4 @@ def to_bytes(proto, string):
1510

1611

1712
def to_string(proto, buf):
18-
ip_addr = netaddr.IPAddress(packed_net_bytes_to_int(buf), version=6)
19-
return six.text_type(ip_addr)
13+
return str(netaddr.IPAddress(int.from_bytes(buf, byteorder='big'), version=6))

0 commit comments

Comments
 (0)