summaryrefslogtreecommitdiff
path: root/dev/run
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2018-10-03 13:30:18 -0400
committerNick Vatamaniuc <vatamane@apache.org>2018-11-26 17:49:33 -0500
commit2a3467d51415569e5f93c0cf4afbc5bbcd1ba17b (patch)
treef033c0f7aa578c035720f75d2f23eaa9a3f41bf8 /dev/run
parent1347806d2feebce53325070b475f9e211d240ddf (diff)
downloadcouchdb-2a3467d51415569e5f93c0cf4afbc5bbcd1ba17b.tar.gz
Switch to python 3
Ran 2to3 and fixed a few deprecated warnings Issue #1632
Diffstat (limited to 'dev/run')
-rwxr-xr-xdev/run11
1 files changed, 6 insertions, 5 deletions
diff --git a/dev/run b/dev/run
index f63c0e091..a4fbfbf8d 100755
--- a/dev/run
+++ b/dev/run
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -34,12 +34,12 @@ from pbkdf2 import pbkdf2_hex
COMMON_SALT = uuid.uuid4().hex
try:
- from urllib import urlopen
+ from urllib.request import urlopen
except ImportError:
from urllib.request import urlopen
try:
- import httplib as httpclient
+ import http.client as httpclient
except ImportError:
import http.client as httpclient
@@ -58,7 +58,8 @@ def log(msg):
if log.verbose:
sys.stdout.write(chars)
sys.stdout.flush()
- callargs = dict(list(zip(inspect.getargspec(func).args, args)))
+ argnames = list(inspect.signature(func).parameters.keys())
+ callargs = dict(list(zip(argnames, args)))
callargs.update(kwargs)
print_('[ * ] ' + msg.format(**callargs) + ' ... ')
try:
@@ -365,7 +366,7 @@ def boot_nodes(ctx):
def ensure_all_nodes_alive(ctx):
- status = dict((num, False) for num in range(ctx['N']))
+ status = dict((num, False) for num in list(range(ctx['N'])))
for _ in range(10):
for num in range(ctx['N']):
if status[num]: