Skip to content

Commit d5473b5

Browse files
committed
Run pyupgrade
1 parent 2031933 commit d5473b5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/smithy-aws-core/src/smithy_aws_core/user_agent.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class UserAgentComponent(NamedTuple):
3535

3636
prefix: str
3737
name: str
38-
value: Optional[str] = None
38+
value: str | None = None
3939

4040
def to_string(self):
4141
"""Create string like 'prefix/name#value' from a UserAgentComponent."""
@@ -132,13 +132,13 @@ def to_string(self) -> str:
132132

133133
return " ".join([comp.to_string() for comp in components])
134134

135-
def _build_sdk_metadata(self) -> List[UserAgentComponent]:
135+
def _build_sdk_metadata(self) -> list[UserAgentComponent]:
136136
"""Build the SDK name and version component of the User-Agent header.
137137
138138
Includes CRT version if available.
139139
"""
140140
sdk_version = self._sdk_version if self._sdk_version else "Unknown"
141-
sdk_md: List[UserAgentComponent] = [
141+
sdk_md: list[UserAgentComponent] = [
142142
UserAgentComponent(_USERAGENT_SDK_NAME, sdk_version)
143143
]
144144

@@ -147,7 +147,7 @@ def _build_sdk_metadata(self) -> List[UserAgentComponent]:
147147

148148
return sdk_md
149149

150-
def _build_os_metadata(self) -> List[UserAgentComponent]:
150+
def _build_os_metadata(self) -> list[UserAgentComponent]:
151151
"""Build the OS/platform components of the User-Agent header string.
152152
153153
For recognized platform names that match or map to an entry in the list
@@ -180,7 +180,7 @@ def _build_os_metadata(self) -> List[UserAgentComponent]:
180180
UserAgentComponent("md", self._platform_name, self._platform_version),
181181
]
182182

183-
def _build_architecture_metadata(self) -> List[UserAgentComponent]:
183+
def _build_architecture_metadata(self) -> list[UserAgentComponent]:
184184
"""Build architecture component of the User-Agent header string.
185185
186186
Returns the machine type with prefix "md" and name "arch", if one is available.
@@ -190,7 +190,7 @@ def _build_architecture_metadata(self) -> List[UserAgentComponent]:
190190
return [UserAgentComponent("md", "arch", self._platform_machine.lower())]
191191
return []
192192

193-
def _build_language_metadata(self) -> List[UserAgentComponent]:
193+
def _build_language_metadata(self) -> list[UserAgentComponent]:
194194
"""Build the language components of the User-Agent header string.
195195
196196
Returns the Python version in a component with prefix "lang" and name
@@ -209,7 +209,7 @@ def _build_language_metadata(self) -> List[UserAgentComponent]:
209209
)
210210
return lang_md
211211

212-
def _build_execution_env_metadata(self) -> List[UserAgentComponent]:
212+
def _build_execution_env_metadata(self) -> list[UserAgentComponent]:
213213
"""Build the execution environment component of the User-Agent header.
214214
215215
Returns a single component prefixed with "exec-env", usually sourced from the
@@ -220,21 +220,21 @@ def _build_execution_env_metadata(self) -> List[UserAgentComponent]:
220220
else:
221221
return []
222222

223-
def _build_feature_metadata(self) -> List[UserAgentComponent]:
223+
def _build_feature_metadata(self) -> list[UserAgentComponent]:
224224
"""Build the features components of the User-Agent header string.
225225
226226
TODO: These should be sourced from property bag set on context.
227227
"""
228228
return []
229229

230-
def _build_app_id(self) -> List[UserAgentComponent]:
230+
def _build_app_id(self) -> list[UserAgentComponent]:
231231
"""Build app component of the User-Agent header string."""
232232
if self._user_agent_app_id:
233233
return [UserAgentComponent("app", self._user_agent_app_id)]
234234
else:
235235
return []
236236

237-
def _build_suffix(self) -> List[_UAComponent]:
237+
def _build_suffix(self) -> list[_UAComponent]:
238238
if self._user_agent_suffix:
239239
return [RawStringUserAgentComponent(self._user_agent_suffix)]
240240
else:

0 commit comments

Comments
 (0)