From 596fe17f163daf15831b9f03d7b9102e9de09330 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Tue, 23 Feb 2016 14:33:16 -0500 Subject: [PATCH] feat(script/check_md_links.py): make python2/3 compatible --- script/check_md_links.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/check_md_links.py b/script/check_md_links.py index 9172feeca..f14e0cc80 100755 --- a/script/check_md_links.py +++ b/script/check_md_links.py @@ -4,8 +4,12 @@ import argparse import collections import os import sys -import urllib.error -import urllib.request +try: + from urllib.request import urlopen + from urllib.parse import urlparse +except ImportError: + from urlparse import urlparse + from urllib import urlopen try: import mistune except ImportError: