src/eric7/Utilities/__init__.py

branch
eric7
changeset 10434
1540e501785f
parent 10433
328f3ec4b77a
child 10435
c712d09cc839
diff -r 328f3ec4b77a -r 1540e501785f src/eric7/Utilities/__init__.py
--- a/src/eric7/Utilities/__init__.py	Thu Dec 21 19:50:01 2023 +0100
+++ b/src/eric7/Utilities/__init__.py	Fri Dec 22 11:04:32 2023 +0100
@@ -1129,14 +1129,16 @@
                         oc += txt[index]
                 o = chr(int(oc, base=8))
             elif c.lower() == "x":
-                index += 1
                 val = 0
-                if index < len(txt) and txt[index] in "0123456789abcdefABCDEF":
+                if index + 1 < len(txt) and txt[index + 1] in "0123456789abcdefABCDEF":
+                    index += 1
                     hx = txt[index]
-                    index += 1
-                    if index < len(txt) and txt[index] in "0123456789abcdefABCDEF":
+                    if (
+                        index + 1 < len(txt)
+                        and txt[index + 1] in "0123456789abcdefABCDEF"
+                    ):
+                        index += 1
                         hx += txt[index]
-                        index += 1
                     val = int(hx, base=16)
                 o = chr(val)
             else:

eric ide

mercurial