Skip to content
Browse files

tools: make Python 3 compatible

PR-URL: #29104
Reviewed-By: Michaël Zasso <>
Reviewed-By: Richard Lau <>
Reviewed-By: Anna Henningsen <>
Reviewed-By: Luigi Pinca <>
Reviewed-By: Sam Roberts <>
Reviewed-By: Rich Trott <>
  • Loading branch information...
cclauss authored and targos committed Aug 13, 2019
1 parent 9057814 commit 31c50e5c17aaca2389fef65b8bb9c4c3a100585a
Showing with 7 additions and 5 deletions.
  1. +7 −5 tools/configure.d/
@@ -2,27 +2,29 @@
# Moved some utilities here from ../../configure

from __future__ import print_function
import urllib
import hashlib
import sys
import zipfile
import tarfile
import fpformat
import contextlib
from urllib.request import FancyURLopener, URLopener
except ImportError:
from urllib import FancyURLopener, URLopener

def formatSize(amt):
"""Format a size as a string in MB"""
return fpformat.fix(amt / 1024000., 1)
return "%.1f" % (amt / 1024000.)

def spin(c):
"""print out an ASCII 'spinner' based on the value of counter 'c'"""
spin = ".:|'"
return (spin[c % len(spin)])

class ConfigOpener(urllib.FancyURLopener):
class ConfigOpener(FancyURLopener):
"""fancy opener used by retrievefile. Set a UA"""
# append to existing version (UA)
version = '%s node.js/configure' % urllib.URLopener.version
version = '%s node.js/configure' % URLopener.version

def reporthook(count, size, total):
"""internal hook used by retrievefile"""

0 comments on commit 31c50e5

Please sign in to comment.
You can’t perform that action at this time.