mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Define execfile, file, long, raw_input, xrange for Python 3
This commit is contained in:
@@ -29,6 +29,12 @@ try:
|
||||
except NameError:
|
||||
unicode = lambda s: str(s)
|
||||
|
||||
try:
|
||||
xrange # Python 2
|
||||
except NameError:
|
||||
xrange = range # Python 3
|
||||
|
||||
|
||||
if re.search("windows", platform.system(), re.I):
|
||||
try:
|
||||
import _winreg
|
||||
@@ -600,7 +606,7 @@ def template(fileName, svg, replaceme="REPLACEME"):
|
||||
|
||||
def load(fileName):
|
||||
"""Loads an SVG image from a file."""
|
||||
return load_stream(file(fileName))
|
||||
return load_stream(open(fileName))
|
||||
|
||||
def load_stream(stream):
|
||||
"""Loads an SVG image from a stream (can be a string or a file object)."""
|
||||
|
||||
Reference in New Issue
Block a user