mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 06:46:13 +01:00
python3 compatibility: unicode
reintroduce unicode function - despite the fact I am pretty sure the usage is plain wrong, because code says - return a unicode string from utf-8 encoded one, which is probably not what was intended. I bet something like encode the input as utf-8 was wanted.
This commit is contained in:
parent
5cc72902e0
commit
f6edc186c2
@ -30,6 +30,7 @@ import subprocess
|
||||
import re
|
||||
import socket
|
||||
import errno
|
||||
|
||||
try:
|
||||
from xml.etree import cElementTree as ET
|
||||
except ImportError:
|
||||
@ -44,6 +45,13 @@ try:
|
||||
except NameError:
|
||||
memoryview = buffer
|
||||
|
||||
try:
|
||||
unicode
|
||||
except:
|
||||
#python3 does not have unicode, so lets reimplement it
|
||||
#as void function as it already gets unicode strings
|
||||
unicode = lambda x, *args: x
|
||||
|
||||
DISTURL_RE = re.compile(r"^(?P<bs>.*)://(?P<apiurl>.*?)/(?P<project>.*?)/(?P<repository>.*?)/(?P<revision>.*)-(?P<source>.*)$")
|
||||
BUILDLOGURL_RE = re.compile(r"^(?P<apiurl>https?://.*?)/build/(?P<project>.*?)/(?P<repository>.*?)/(?P<arch>.*?)/(?P<package>.*?)/_log$")
|
||||
BUFSIZE = 1024*1024
|
||||
|
Loading…
Reference in New Issue
Block a user