diff options
author | Rashed Abdel-Tawab <rashed@linux.com> | 2019-10-05 00:18:41 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2019-10-05 04:41:40 +0000 |
commit | 2058c6364180a899bc17b8cefba193f931ef4493 (patch) | |
tree | 8d911e486a6f7baa7e687ccdd0e15bb88090c21f /main.py | |
parent | c8290ad49e441424b59b88dce3af9919247ca364 (diff) | |
download | git-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-x | main.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -23,7 +23,6 @@ which takes care of execing this entry point. | |||
23 | 23 | ||
24 | from __future__ import print_function | 24 | from __future__ import print_function |
25 | import getpass | 25 | import getpass |
26 | import imp | ||
27 | import netrc | 26 | import netrc |
28 | import optparse | 27 | import optparse |
29 | import os | 28 | import os |
@@ -34,6 +33,7 @@ from pyversion import is_python3 | |||
34 | if is_python3(): | 33 | if is_python3(): |
35 | import urllib.request | 34 | import urllib.request |
36 | else: | 35 | else: |
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 |