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

Unified Diff: checkout.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
« no previous file with comments | « no previous file | third_party/upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: checkout.py
diff --git a/checkout.py b/checkout.py
index bed4737507250693f074cda16583649574eb5119..8f7c4be2baa44bdaf5c739c891b308ad7ad871ec 100644
--- a/checkout.py
+++ b/checkout.py
@@ -7,7 +7,6 @@
Includes support for svn, git-svn and git.
"""
-import ConfigParser
import fnmatch
import logging
import os
@@ -17,6 +16,12 @@ import subprocess
import sys
import tempfile
+# The configparser module was renamed in Python 3.
nodir 2016/06/16 18:55:58 this comment should be inside except clause
vapier 2016/06/16 19:13:47 "configparser" is the py3 name which is in the try
+try:
+ import configparser
+except ImportError:
+ import ConfigParser as configparser
+
import patch
import scm
import subprocess2
@@ -258,7 +263,7 @@ class SvnConfig(object):
self.svn_config_dir = os.path.expanduser(
os.path.join('~', '.subversion'))
svn_config_file = os.path.join(self.svn_config_dir, 'config')
- parser = ConfigParser.SafeConfigParser()
+ parser = configparser.SafeConfigParser()
if os.path.isfile(svn_config_file):
parser.read(svn_config_file)
else:
« no previous file with comments | « no previous file | third_party/upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698