]> arthur.barton.de Git - bup.git/commitdiff
some_invalid_save_parts_rx: avoid nested char set
authorRob Browning <rlb@defaultvalue.org>
Tue, 10 Sep 2019 07:10:08 +0000 (02:10 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 5 Oct 2019 15:37:32 +0000 (10:37 -0500)
Escape square bracket to avoid possible future trouble with Python 3+:

  >>> re.compile(r'[[ ~^:?*\\]|\.\.|//|@{')
  __main__:1: FutureWarning: Possible nested set at position 1

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py

index bbfaf3e26d5acd56aede5fd2f54e0640ccb3a442..9a1218b9f8f4030c29a41af8163b1b6dd611e01a 100644 (file)
@@ -1174,7 +1174,7 @@ else:
         return x
 
 
-_some_invalid_save_parts_rx = re.compile(r'[[ ~^:?*\\]|\.\.|//|@{')
+_some_invalid_save_parts_rx = re.compile(r'[\[ ~^:?*\\]|\.\.|//|@{')
 
 def valid_save_name(name):
     # Enforce a superset of the restrictions in git-check-ref-format(1)