mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-24 07:58:11 +01:00
Merge revision 1404 changes:
- Use subprocess instead of os.popen3 to avoid deprecation warnings. git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1453@1406 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
b81a6bff53
commit
4999e9ab14
@ -48,10 +48,11 @@ def get_svn_info(path):
|
|||||||
rev = 'None'
|
rev = 'None'
|
||||||
if path[0:4] == 'http' or os.path.exists(path):
|
if path[0:4] == 'http' or os.path.exists(path):
|
||||||
try:
|
try:
|
||||||
(stream_in, stream_out, stream_err) = os.popen3(svn_exe+' info --xml '+path)
|
p = subprocess.Popen([svn_exe, 'info', '--xml', path], \
|
||||||
err = stream_err.read()
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
out, err = p.communicate()
|
||||||
if err == '':
|
if err == '':
|
||||||
tree = ET.ElementTree(ET.fromstring(stream_out.read()))
|
tree = ET.ElementTree(ET.fromstring(out))
|
||||||
entry = tree.getroot().find('entry')
|
entry = tree.getroot().find('entry')
|
||||||
url = entry.find('url').text
|
url = entry.find('url').text
|
||||||
rev = entry.attrib['revision']
|
rev = entry.attrib['revision']
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import subprocess
|
||||||
import urllib
|
import urllib
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
@ -28,10 +29,11 @@ def get_svn_info(path):
|
|||||||
svn = 'svn.bat'
|
svn = 'svn.bat'
|
||||||
else:
|
else:
|
||||||
svn = 'svn'
|
svn = 'svn'
|
||||||
(stream_in, stream_out, stream_err) = os.popen3(svn+' info --xml '+path)
|
p = subprocess.Popen([svn, 'info', '--xml', path], \
|
||||||
err = stream_err.read()
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
out, err = p.communicate()
|
||||||
if err == '':
|
if err == '':
|
||||||
tree = ET.ElementTree(ET.fromstring(stream_out.read()))
|
tree = ET.ElementTree(ET.fromstring(out))
|
||||||
entry = tree.getroot().find('entry')
|
entry = tree.getroot().find('entry')
|
||||||
url = entry.find('url').text
|
url = entry.find('url').text
|
||||||
rev = entry.attrib['revision']
|
rev = entry.attrib['revision']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user