From 2058c6364180a899bc17b8cefba193f931ef4493 Mon Sep 17 00:00:00 2001 From: Rashed Abdel-Tawab Date: Sat, 5 Oct 2019 00:18:41 -0400 Subject: [PATCH] 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 Reviewed-by: Mike Frysinger --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. from __future__ import print_function import getpass -import imp import netrc import optparse import os @@ -34,6 +33,7 @@ from pyversion import is_python3 if is_python3(): import urllib.request else: + import imp import urllib2 urllib = imp.new_module('urllib') urllib.request = urllib2