title: Neat way of making urllib work with python 2 and 3
body: <p>I'm looking for suggestions on how to combine the two code snippets so that they work with both python 2 and 3. The goal is to make it "neat", ideally keeping it to one line and limiting any if/else/try/except constructs. </p>
  
  <p>For python 3.x</p>
  
  <pre><code>   import xml.etree.ElementTree as ET, urllib.request, gzip, io
     url = "https://github.com/OpenExoplanetCatalogue/oec_gzip/raw/master/systems.xml.gz"
     oec = ET.parse(gzip.GzipFile(fileobj=io.BytesIO(urllib.request.urlopen(url).read())))
  </code></pre>
  
  <p>For python 2.x</p>
  
  <pre><code>  import xml.etree.ElementTree as ET, urllib, gzip, io
    url = "https://github.com/OpenExoplanetCatalogue/oec_gzip/raw/master/systems.xml.gz"
    oec = ET.parse(gzip.GzipFile(fileobj=io.BytesIO(urllib.urlopen(url).read())))
  </code></pre>