summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-02-25 23:23:48 (GMT)
committerPeter Wu <peter@lekensteyn.nl>2016-03-11 22:35:01 (GMT)
commitf7491398a2e97c7c76d5a28cfb3b8ce1a0a1a580 (patch)
tree5928ac220fb3344834e1ff0e4af5f16c00eb1d97 /src
parent572cc8eb6f70e3acbae57e586788f15e9b562f96 (diff)
downloadNinja-f7491398a2e97c7c76d5a28cfb3b8ce1a0a1a580.zip
Ninja-f7491398a2e97c7c76d5a28cfb3b8ce1a0a1a580.tar.gz
Ninja-f7491398a2e97c7c76d5a28cfb3b8ce1a0a1a580.tar.bz2
browse.py: Python 3 compatibility
Diffstat (limited to 'src')
-rwxr-xr-xsrc/browse.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/browse.py b/src/browse.py
index 081eb8c..bf85e4d 100755
--- a/src/browse.py
+++ b/src/browse.py
@@ -31,7 +31,10 @@ import socket
import subprocess
import sys
import webbrowser
-import urllib2
+try:
+ from urllib.request import unquote
+except ImportError:
+ from urllib2 import unquote
from collections import namedtuple
Node = namedtuple('Node', ['inputs', 'rule', 'target', 'outputs'])
@@ -154,7 +157,7 @@ def ninja_dump(target):
class RequestHandler(httpserver.BaseHTTPRequestHandler):
def do_GET(self):
assert self.path[0] == '/'
- target = urllib2.unquote(self.path[1:])
+ target = unquote(self.path[1:])
if target == '':
self.send_response(302)