Skip to content
Snippets Groups Projects
Commit e8c1fcfd authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge branch 'compatibility' into 'master'

Bring old imports back for more compatibility

See merge request !37
parents cba205a8 dbb35119
No related branches found
No related tags found
1 merge request!37Bring old imports back for more compatibility
Pipeline #60542 passed
...@@ -3,7 +3,7 @@ import numpy as np ...@@ -3,7 +3,7 @@ import numpy as np
import h5py import h5py
import imageio import imageio
from .utils import to_bob, to_matplotlib, opencvbgr_to_bob, bob_to_opencvbgr, imshow from ..image import to_bob, to_matplotlib
import logging import logging
...@@ -34,17 +34,8 @@ image_extensions = [ ...@@ -34,17 +34,8 @@ image_extensions = [
def _is_string(s): def _is_string(s):
"""Returns ``True`` if the given object is a string """Returns ``True`` if the given object is a string or bytes."""
return isinstance(s, (bytes, str))
This method can be used with Python-2.x or 3.x and returns a string
respecting each environment's constraints.
"""
from sys import version_info
return (version_info[0] < 3 and isinstance(s, (str, unicode))) or isinstance(
s, (bytes, str)
)
@np.deprecate(new_name="os.makedirs(directory, exist_ok=True)") @np.deprecate(new_name="os.makedirs(directory, exist_ok=True)")
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import os import os
from bob.io.base import load, save from bob.io.base import load, save
from .test_utils import temporary_filename from ..test_utils import temporary_filename
import numpy as np import numpy as np
......
...@@ -12,7 +12,7 @@ import os ...@@ -12,7 +12,7 @@ import os
import numpy import numpy
from bob.io.base import load, write from bob.io.base import load, write
from .test_utils import datafile, temporary_filename from ..test_utils import datafile, temporary_filename
# import bob.io.image # import bob.io.image
import nose import nose
......
...@@ -2,7 +2,7 @@ import nose ...@@ -2,7 +2,7 @@ import nose
import numpy as np import numpy as np
import os import os
from bob.io.base import vstack_features, save, load from bob.io.base import vstack_features, save, load
from .test_utils import temporary_filename from ..test_utils import temporary_filename
def test_io_vstack(): def test_io_vstack():
......
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment