summaryrefslogtreecommitdiff
path: root/buildscripts/eslint.py
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2019-02-19 10:50:57 -0500
committerMathew Robinson <chasinglogic@gmail.com>2019-04-08 14:08:49 -0400
commit8dd6d4755734ed37c1b98dfdefce3ca6bc65f1f6 (patch)
tree69e936c4953cbead2e3bae2690157c5fe75e709d /buildscripts/eslint.py
parentc600aa9d7423eca8151daf626e2799d9a6c7b31c (diff)
downloadmongo-8dd6d4755734ed37c1b98dfdefce3ca6bc65f1f6.tar.gz
SERVER-32295 Support Python 3
Diffstat (limited to 'buildscripts/eslint.py')
-rwxr-xr-xbuildscripts/eslint.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py
index bb365311640..aa962331c39 100755
--- a/buildscripts/eslint.py
+++ b/buildscripts/eslint.py
@@ -10,7 +10,7 @@ There is also a -d mode that assumes you only want to run one copy of ESLint per
parameter supplied. This lets ESLint search for candidate files to lint.
"""
-from __future__ import print_function
+
import os
import shutil
@@ -20,7 +20,7 @@ import sys
import tarfile
import tempfile
import threading
-import urllib
+import urllib.request, urllib.parse, urllib.error
from distutils import spawn # pylint: disable=no-name-in-module
from optparse import OptionParser
@@ -57,7 +57,7 @@ ESLINT_SOURCE_TAR_BASE = string.Template(ESLINT_PROGNAME + "-$platform-$arch")
def callo(args):
"""Call a program, and capture its output."""
- return subprocess.check_output(args)
+ return subprocess.check_output(args).decode('utf-8')
def extract_eslint(tar_path, target_file):
@@ -84,7 +84,7 @@ def get_eslint_from_cache(dest_file, platform, arch):
# Download the file
print("Downloading ESLint %s from %s, saving to %s" % (ESLINT_VERSION, url, temp_tar_file))
- urllib.urlretrieve(url, temp_tar_file)
+ urllib.request.urlretrieve(url, temp_tar_file)
eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(platform=platform, arch=arch)
extract_eslint(temp_tar_file, eslint_distfile)