@@ -3031,7 +3031,7 @@ def gen_string_dictfirstreverse(context: dict, value: str):
3031
3031
def gen_string_x1 (context : dict , value : str ):
3032
3032
if any (ord (c ) >= 128 for c in value ):
3033
3033
return [(UNSATISFIED ,)]
3034
- target = "" .join ("\\ x" + hex (ord (c ))[2 :] for c in value )
3034
+ target = "" .join ("\\ x" + hex (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3035
3035
target_list = [(LITERAL , '"{}"' .format (target ))]
3036
3036
return [(EXPRESSION , precedence ["literal" ], target_list )]
3037
3037
@@ -3040,7 +3040,7 @@ def gen_string_x1(context: dict, value: str):
3040
3040
def gen_string_x2 (context : dict , value : str ):
3041
3041
if any (ord (c ) >= 128 for c in value ):
3042
3042
return [(UNSATISFIED ,)]
3043
- target = "" .join ("\\ x" + hex (ord (c ))[2 :] for c in value )
3043
+ target = "" .join ("\\ x" + hex (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3044
3044
target_list = [(LITERAL , "'{}'" .format (target ))]
3045
3045
return [(EXPRESSION , precedence ["literal" ], target_list )]
3046
3046
@@ -3049,7 +3049,7 @@ def gen_string_x2(context: dict, value: str):
3049
3049
def gen_string_u1 (context : dict , value : str ):
3050
3050
if any (ord (c ) >= 128 for c in value ):
3051
3051
return [(UNSATISFIED ,)]
3052
- target = "" .join ("\\ u00" + hex (ord (c ))[2 :] for c in value )
3052
+ target = "" .join ("\\ u00" + hex (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3053
3053
target_list = [(LITERAL , "'{}'" .format (target ))]
3054
3054
return [(EXPRESSION , precedence ["literal" ], target_list )]
3055
3055
@@ -3058,7 +3058,7 @@ def gen_string_u1(context: dict, value: str):
3058
3058
def gen_string_u2 (context : dict , value : str ):
3059
3059
if any (ord (c ) >= 128 for c in value ):
3060
3060
return [(UNSATISFIED ,)]
3061
- target = "" .join ("\\ u00" + hex (ord (c ))[2 :] for c in value )
3061
+ target = "" .join ("\\ u00" + hex (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3062
3062
target_list = [(LITERAL , "'{}'" .format (target ))]
3063
3063
return [(EXPRESSION , precedence ["literal" ], target_list )]
3064
3064
@@ -3067,7 +3067,7 @@ def gen_string_u2(context: dict, value: str):
3067
3067
def gen_string_o1 (context : dict , value : str ):
3068
3068
if any (ord (c ) >= 128 for c in value ):
3069
3069
return [(UNSATISFIED ,)]
3070
- target = "" .join ("\\ " + oct (ord (c ))[2 :] for c in value )
3070
+ target = "" .join ("\\ " + oct (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3071
3071
target_list = [(LITERAL , "'{}'" .format (target ))]
3072
3072
return [(EXPRESSION , precedence ["literal" ], target_list )]
3073
3073
@@ -3076,7 +3076,7 @@ def gen_string_o1(context: dict, value: str):
3076
3076
def gen_string_o2 (context : dict , value : str ):
3077
3077
if any (ord (c ) >= 128 for c in value ):
3078
3078
return [(UNSATISFIED ,)]
3079
- target = "" .join ("\\ " + oct (ord (c ))[2 :] for c in value )
3079
+ target = "" .join ("\\ " + oct (ord (c ))[2 :]. zfill ( 2 ) for c in value )
3080
3080
target_list = [(LITERAL , "'{}'" .format (target ))]
3081
3081
return [(EXPRESSION , precedence ["literal" ], target_list )]
3082
3082
0 commit comments