diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2015-01-31 21:43:50 +0100 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2016-02-04 16:32:27 +0200 |
commit | cb471dd8c188eb785665ec97676f072700445881 (patch) | |
tree | 0d01dd273376ed39fdf18dd399adadd0de39caa2 | |
parent | 225cb19d2695945a8146484276b03fa541b55536 (diff) |
Add external dependency on the total_ordering package.
It is used as a compatibility workaround for python 2.6.
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
-rw-r--r-- | registry/gl.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/registry/gl.py b/registry/gl.py index e87bf5ca5..f00f9057f 100644 --- a/registry/gl.py +++ b/registry/gl.py @@ -29,7 +29,11 @@ from __future__ import print_function import os.path import re import sys -import functools +try: + from functools import total_ordering +except ImportError: + from total_ordering import total_ordering + from copy import copy, deepcopy import six @@ -382,7 +386,7 @@ class Registry(object): self.vendor_namespaces.remove(None) -@functools.total_ordering +@total_ordering class Feature(object): """A <feature> XML element. @@ -487,7 +491,7 @@ class Feature(object): link(enum) -@functools.total_ordering +@total_ordering class Extension(object): """An <extension> XML element. @@ -604,7 +608,7 @@ class Extension(object): link(xml_req, enum) -@functools.total_ordering +@total_ordering class Requirement(object): """A <require> XML element, which links a provider (Feature or Extension) to a provided (Command or Enum) for a set of apis. @@ -722,7 +726,7 @@ class CommandParam(object): return templ.format(self=self) -@functools.total_ordering +@total_ordering class Command(object): """A <command> XML element. @@ -879,7 +883,7 @@ class Command(object): ) -@functools.total_ordering +@total_ordering class CommandAliasSet(ImmutableOrderedKeyedSet): def __init__(self, commands): @@ -1109,7 +1113,7 @@ class EnumGroup(object): self.type = 'special' -@functools.total_ordering +@total_ordering class Enum(object): """An <enum> XML element. |