@@ -2204,7 +2204,7 @@ def analyze_namedtuple_assign(self, s: AssignmentStmt) -> bool:
22042204 self .fail ("NamedTuple type as an attribute is not supported" , lvalue )
22052205 return False
22062206 if internal_name != name :
2207- self .fail (" First argument to namedtuple() should be '{}' , not '{}'" .format (
2207+ self .fail (' First argument to namedtuple() should be "{}" , not "{}"' .format (
22082208 name , internal_name ), s .rvalue , code = codes .NAME_MATCH )
22092209 return True
22102210 # Yes, it's a valid namedtuple, but defer if it is not ready.
@@ -2938,7 +2938,7 @@ def process_typevar_declaration(self, s: AssignmentStmt) -> bool:
29382938 # Also give error for another type variable with the same name.
29392939 (isinstance (existing .node , TypeVarExpr ) and
29402940 existing .node is call .analyzed )):
2941- self .fail (" Cannot redefine '%s' as a type variable" % name , s )
2941+ self .fail (' Cannot redefine "%s" as a type variable' % name , s )
29422942 return False
29432943
29442944 if self .options .disallow_any_unimported :
@@ -2993,7 +2993,7 @@ def check_typevarlike_name(self, call: CallExpr, name: str, context: Context) ->
29932993 context )
29942994 return False
29952995 elif call .args [0 ].value != name :
2996- msg = " String argument 1 '{}' to {}(...) does not match variable name '{}'"
2996+ msg = ' String argument 1 "{}" to {}(...) does not match variable name "{}"'
29972997 self .fail (msg .format (call .args [0 ].value , typevarlike_type , name ), context )
29982998 return False
29992999 return True
@@ -3068,20 +3068,20 @@ def process_typevar_parameters(self, args: List[Expression],
30683068 analyzed = PlaceholderType (None , [], context .line )
30693069 upper_bound = get_proper_type (analyzed )
30703070 if isinstance (upper_bound , AnyType ) and upper_bound .is_from_error :
3071- self .fail (" TypeVar ' bound' must be a type" , param_value )
3071+ self .fail (' TypeVar " bound" must be a type' , param_value )
30723072 # Note: we do not return 'None' here -- we want to continue
30733073 # using the AnyType as the upper bound.
30743074 except TypeTranslationError :
3075- self .fail (" TypeVar ' bound' must be a type" , param_value )
3075+ self .fail (' TypeVar " bound" must be a type' , param_value )
30763076 return None
30773077 elif param_name == 'values' :
30783078 # Probably using obsolete syntax with values=(...). Explain the current syntax.
3079- self .fail (" TypeVar ' values' argument not supported" , context )
3079+ self .fail (' TypeVar " values" argument not supported' , context )
30803080 self .fail ("Use TypeVar('T', t, ...) instead of TypeVar('T', values=(t, ...))" ,
30813081 context )
30823082 return None
30833083 else :
3084- self .fail (" Unexpected argument to TypeVar(): {}" .format (param_name ), context )
3084+ self .fail (' Unexpected argument to TypeVar(): " {}"' .format (param_name ), context )
30853085 return None
30863086
30873087 if covariant and contravariant :
0 commit comments