summaryrefslogtreecommitdiff
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
parent1347806d2feebce53325070b475f9e211d240ddf (diff)
downloadcouchdb-2a3467d51415569e5f93c0cf4afbc5bbcd1ba17b.tar.gz
Switch to python 3
Ran 2to3 and fixed a few deprecated warnings Issue #1632
-rwxr-xr-xbuild-aux/logfile-uploader.py4
-rwxr-xr-xdev/run11
-rwxr-xr-xrel/overlay/bin/couchup4
-rwxr-xr-xtest/javascript/run2
4 files changed, 11 insertions, 10 deletions
diff --git a/build-aux/logfile-uploader.py b/build-aux/logfile-uploader.py
index a1ff7e4a7..c95eab532 100755
--- a/build-aux/logfile-uploader.py
+++ b/build-aux/logfile-uploader.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/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
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.
-from __future__ import print_function
+
import datetime
import glob
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]:
diff --git a/rel/overlay/bin/couchup b/rel/overlay/bin/couchup
index 75b7d7e94..41ac4b857 100755
--- a/rel/overlay/bin/couchup
+++ b/rel/overlay/bin/couchup
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/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
# the License at
@@ -19,7 +19,7 @@ import threading
import time
import sys
try:
- from urllib import quote
+ from urllib.parse import quote
except ImportError:
from urllib.parse import quote
import requests
diff --git a/test/javascript/run b/test/javascript/run
index ec12431b0..283a7f779 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/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