1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-04 01:56:15 +02:00

git-p4: python3: basestring workaround

In Python3, basestring no longer exists, so use this workaround.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Luke Diamand 2018-06-19 09:04:09 +01:00 committed by Junio C Hamano
parent 4d88519f6a
commit efdcc99263

View File

@ -27,6 +27,22 @@
import ctypes
import errno
# support basestring in python3
try:
unicode = unicode
except NameError:
# 'unicode' is undefined, must be Python 3
str = str
unicode = str
bytes = bytes
basestring = (str,bytes)
else:
# 'unicode' exists, must be Python 2
str = str
unicode = unicode
bytes = str
basestring = basestring
try:
from subprocess import CalledProcessError
except ImportError: