Only import imp on py2

imp is deprecatedon py3. It's also not used with py3, so just move it
to the py2 import block

Test: run `repo` command and verify warning is no longer present
Test: verify `repo sync` and `repo upload` function as expected
Change-Id: I9d59403d7819c4a478c9f54cbef114f8a96486a5
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239713
Tested-by: Rashed Abdel-Tawab <rashedabdeltawab@gmail.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Rashed Abdel-Tawab 2019-10-05 00:18:41 -04:00 committed by Mike Frysinger
parent c8290ad49e
commit 2058c63641

View File

@ -23,7 +23,6 @@ which takes care of execing this entry point.
from __future__ import print_function from __future__ import print_function
import getpass import getpass
import imp
import netrc import netrc
import optparse import optparse
import os import os
@ -34,6 +33,7 @@ from pyversion import is_python3
if is_python3(): if is_python3():
import urllib.request import urllib.request
else: else:
import imp
import urllib2 import urllib2
urllib = imp.new_module('urllib') urllib = imp.new_module('urllib')
urllib.request = urllib2 urllib.request = urllib2