The previous import should not have worked, urllib is just a namespace and does not import other modules under it. I suppose that it works by chance because other modules in Electrum ABC properly import urllibe.parse and urllib.request
The issue can be reproduced by attempting to run the test_util suite on its own:
$ python -m electrumabc.tests.test_util s.........s.........sEEEEEE..EE........... ====================================================================== ERROR: test_parse_URI_address (__main__.TestUtil) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pierre/dev/bitcoin-abc/electrum/electrumabc/tests/test_util.py", line 165, in test_parse_URI_address self._do_test_parse_URI( File "/home/pierre/dev/bitcoin-abc/electrum/electrumabc/tests/test_util.py", line 161, in _do_test_parse_URI result = parse_URI(uri) File "/home/pierre/dev/bitcoin-abc/electrum/electrumabc/web.py", line 248, in parse_URI u = urllib.parse.urlparse(uri) AttributeError: module 'urllib' has no attribute 'parse'
Or simply
$ python -c "import urllib; urllib.parse" Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: module 'urllib' has no attribute 'parse'