summaryrefslogtreecommitdiff
path: root/examples/getNTPserversNew.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-10-19 09:20:40 -0700
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-10-19 11:20:40 -0500
commit87d14e7ef563263417d3fddccd25636741c5b6c2 (patch)
tree4a8a5db3c1fe12043955b56e7c7c19253c823c7e /examples/getNTPserversNew.py
parent69aea3980e2e3c848ae1c7b0ce7539bbdc8daf27 (diff)
downloadpyparsing-git-87d14e7ef563263417d3fddccd25636741c5b6c2.tar.gz
Py3 cleanup: Remove workaround for Python2 urllib (#143)
For Python 3 only code, the import path is known and stable. Can remove the ImportError workaround.
Diffstat (limited to 'examples/getNTPserversNew.py')
-rw-r--r--examples/getNTPserversNew.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/examples/getNTPserversNew.py b/examples/getNTPserversNew.py
index ab392dc..af47c73 100644
--- a/examples/getNTPserversNew.py
+++ b/examples/getNTPserversNew.py
@@ -8,13 +8,7 @@
#
import pyparsing as pp
ppc = pp.pyparsing_common
-
-try:
- import urllib.request
- urlopen = urllib.request.urlopen
-except ImportError:
- import urllib
- urlopen = urllib.urlopen
+from urllib.request import urlopen
integer = pp.Word(pp.nums)
ipAddress = ppc.ipv4_address()