summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorRashed Abdel-Tawab <rashed@linux.com>2019-10-05 00:18:41 -0400
committerMike Frysinger <vapier@google.com>2019-10-05 04:41:40 +0000
commit2058c6364180a899bc17b8cefba193f931ef4493 (patch)
tree8d911e486a6f7baa7e687ccdd0e15bb88090c21f /main.py
parentc8290ad49e441424b59b88dce3af9919247ca364 (diff)
downloadgit-repo-2058c6364180a899bc17b8cefba193f931ef4493.tar.gz
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>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.py b/main.py
index 515cdf47..6e74d5a4 100755
--- a/main.py
+++ b/main.py
@@ -23,7 +23,6 @@ which takes care of execing this entry point.
23 23
24from __future__ import print_function 24from __future__ import print_function
25import getpass 25import getpass
26import imp
27import netrc 26import netrc
28import optparse 27import optparse
29import os 28import os
@@ -34,6 +33,7 @@ from pyversion import is_python3
34if is_python3(): 33if is_python3():
35 import urllib.request 34 import urllib.request
36else: 35else:
36 import imp
37 import urllib2 37 import urllib2
38 urllib = imp.new_module('urllib') 38 urllib = imp.new_module('urllib')
39 urllib.request = urllib2 39 urllib.request = urllib2