Skip to content

Commit c63607c

Browse files
committed
2to3: Migrate to python3
1 parent 8937cca commit c63607c

File tree

5 files changed

+5
-14
lines changed

5 files changed

+5
-14
lines changed

ncdu_s3/__init__.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
from .ncdu_data_writer import NcduDataWriter
42
from .directory_walker import DirectoryWalker
53
from .s3_directory_generator import S3DirectoryGenerator

ncdu_s3/directory_walker.py

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

53

@@ -20,7 +18,7 @@ def process_item(self, path, size):
2018
conflict = False
2119
add_dirs = []
2220

23-
for p1, p2 in itertools.izip_longest(self.current_path, path):
21+
for p1, p2 in itertools.zip_longest(self.current_path, path):
2422
if p1 != p2:
2523
# first conflict starts another logic in our code
2624
conflict = True

ncdu_s3/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import absolute_import
21
import click
32
from ncdu_s3 import NcduDataWriter, DirectoryWalker, S3DirectoryGenerator
43

@@ -12,7 +11,7 @@ def main(ctx, s3_url, output):
1211

1312
try:
1413
s3_directory_generator = S3DirectoryGenerator(s3_url)
15-
except SyntaxError, e:
14+
except SyntaxError as e:
1615
ctx.fail(e.message)
1716
return
1817

ncdu_s3/ncdu_data_writer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
import time
42
import ujson as json
53

@@ -62,7 +60,7 @@ def file_entry(self, name, size):
6260
json.dump({'name': name, 'dsize': size}, self.output)
6361

6462
def close(self):
65-
for i in xrange(self.depth):
63+
for i in range(self.depth):
6664
self.dir_leave()
6765

6866
# close the format JSON document we opened in our constructor

ncdu_s3/s3_directory_generator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
from __future__ import absolute_import
2-
3-
import urlparse
1+
import urllib.parse
42
import boto3
53

64
class S3DirectoryGenerator(object):
75
def __init__(self, s3_url):
8-
parsed_s3_url = urlparse.urlparse(s3_url)
6+
parsed_s3_url = urllib.parse.urlparse(s3_url)
97
if parsed_s3_url.scheme != 's3':
108
raise SyntaxError('Invalid S3 scheme')
119

0 commit comments

Comments
 (0)