Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
python-jsonschema.22666
webcolors.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File webcolors.patch of Package python-jsonschema.22666
From 0d192e192526252c30c16b3651c293bb5f21a99f Mon Sep 17 00:00:00 2001 From: Julian Berman <Julian@GrayVines.com> Date: Fri, 21 Feb 2020 09:56:13 -0500 Subject: [PATCH] Sigh... but also drops Py2 compat. --- jsonschema/_format.py | 11 ++++++++--- setup.cfg | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) Index: jsonschema-3.2.0/jsonschema/_format.py =================================================================== --- jsonschema-3.2.0.orig/jsonschema/_format.py +++ jsonschema-3.2.0/jsonschema/_format.py @@ -342,10 +342,15 @@ def is_draft3_time(instance): return datetime.datetime.strptime(instance, "%H:%M:%S") -try: +try: # webcolors>=1.11 + from webcolors import CSS21_NAMES_TO_HEX import webcolors except ImportError: - pass + try: # webcolors<1.11 + from webcolors import css21_names_to_hex as CSS21_NAMES_TO_HEX + import webcolors + except ImportError: + pass else: def is_css_color_code(instance): return webcolors.normalize_hex(instance) @@ -354,7 +359,7 @@ else: def is_css21_color(instance): if ( not isinstance(instance, str_types) or - instance.lower() in webcolors.css21_names_to_hex + instance.lower() in CSS21_NAMES_TO_HEX ): return True return is_css_color_code(instance)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor