mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
fix some sync error while using python3
Change-Id: I70925e48756c356d48359679d8ad1b9e33a68595
This commit is contained in:
parent
65b0ba5aa0
commit
e469a0c741
@ -18,6 +18,8 @@ from __future__ import print_function
|
|||||||
import json
|
import json
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
|
from pyversion import is_python3
|
||||||
|
|
||||||
TASK_COMMAND = 'command'
|
TASK_COMMAND = 'command'
|
||||||
TASK_SYNC_NETWORK = 'sync-network'
|
TASK_SYNC_NETWORK = 'sync-network'
|
||||||
TASK_SYNC_LOCAL = 'sync-local'
|
TASK_SYNC_LOCAL = 'sync-local'
|
||||||
@ -71,7 +73,7 @@ class EventLog(object):
|
|||||||
A dictionary of the event added to the log.
|
A dictionary of the event added to the log.
|
||||||
"""
|
"""
|
||||||
event = {
|
event = {
|
||||||
'id': (kind, self._next_id.next()),
|
'id': (kind, self._next_id.__next__() if is_python3() else self._next_id.next()),
|
||||||
'name': name,
|
'name': name,
|
||||||
'task_name': task_name,
|
'task_name': task_name,
|
||||||
'start_time': start,
|
'start_time': start,
|
||||||
|
@ -306,7 +306,9 @@ class GitConfig(object):
|
|||||||
d = self._do('--null', '--list')
|
d = self._do('--null', '--list')
|
||||||
if d is None:
|
if d is None:
|
||||||
return c
|
return c
|
||||||
for line in d.decode('utf-8').rstrip('\0').split('\0'):
|
if not is_python3():
|
||||||
|
d = d.decode('utf-8')
|
||||||
|
for line in d.rstrip('\0').split('\0'):
|
||||||
if '\n' in line:
|
if '\n' in line:
|
||||||
key, val = line.split('\n', 1)
|
key, val = line.split('\n', 1)
|
||||||
else:
|
else:
|
||||||
|
@ -20,7 +20,12 @@ import select
|
|||||||
import shutil
|
import shutil
|
||||||
import stat
|
import stat
|
||||||
|
|
||||||
|
from pyversion import is_python3
|
||||||
|
if is_python3():
|
||||||
|
from queue import Queue
|
||||||
|
else:
|
||||||
from Queue import Queue
|
from Queue import Queue
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user