]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
Do not limit valid UUID to version 4
[mpd-sima.git] / sima / lib / meta.py
index 7cfb54fa56a63545c50f2b651bea8109ba2dfba7..39b3197573c9e78456cdcbbfaf8f5854d90f18ae 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2013, 2014, 2015 kaliko <kaliko@azylum.org>
+# Copyright (c) 2013, 2014, 2015, 2021 kaliko <kaliko@azylum.org>
 #
 #  This file is part of sima
 #
 Defines some object to handle audio file metadata
 """
 
-try:
-    from collections.abc import Set # python >= 3.3
-except ImportError:
-    from collections import Set # python 3.2
+
+from collections.abc import Set
 import logging
 import re
 
-UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$'
+UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[89AB][a-f0-9]{3}-[a-f0-9]{12}$'
 # The Track Object is collapsing multiple tags into a single string using this
 # separator. It is used then to split back the string to tags list.
 SEPARATOR = chr(0x1F)  # ASCII Unit Separator