Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: third_party/upload.py

Issue 2076653002: handle configparser rename in python3 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« checkout.py ('K') | « checkout.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/upload.py
diff --git a/third_party/upload.py b/third_party/upload.py
index e2b8ed471ace7ba2bebaf3057fb127161e1edf08..f44136fc8f869f119d89fd6068f49723bae1f971 100755
--- a/third_party/upload.py
+++ b/third_party/upload.py
@@ -36,7 +36,6 @@ against by using the '--rev' option.
from __future__ import print_function
-import ConfigParser
import cookielib
import errno
import fnmatch
@@ -56,6 +55,12 @@ import urlparse
from multiprocessing.pool import ThreadPool
+# The configparser module was renamed in Python 3.
+try:
+ import configparser
+except ImportError:
+ import ConfigParser as configparser
+
# The md5 module was deprecated in Python 2.5.
try:
from hashlib import md5
@@ -2241,7 +2246,7 @@ def LoadSubversionAutoProperties():
subversion_config = os.path.expanduser("~/.subversion/config")
if not os.path.exists(subversion_config):
return {}
- config = ConfigParser.ConfigParser()
+ config = configparser.ConfigParser()
config.read(subversion_config)
if (config.has_section("miscellany") and
config.has_option("miscellany", "enable-auto-props") and
« checkout.py ('K') | « checkout.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698