Commit 6dd17914 authored by Benjamin Renard's avatar Benjamin Renard Committed by Adrian DC
Browse files

fix: resolve #254: fix compatibility with Colored 2.x versions

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 21406cf3
Loading
Loading
Loading
Loading
+5 −2
Changes for gitlabci_local/prints/colors.py: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,7 +5,10 @@ from typing import List

# Modules libraries
try:
    from colored import attr, colored, fg
    try: # colored>=2.0.0
        from colored import attr, Colored, fg
    except ImportError: # colored<2.0.0, pragma: no cover
        from colored import attr, colored as Colored, fg
except ModuleNotFoundError: # pragma: no cover
    pass

@@ -29,7 +32,7 @@ class Colors:

        # Result
        try:
            return bool(colored('').enabled())
            return bool(Colored('').enabled())
        except (NameError, TypeError): # pragma: no cover
            return False