Remove try-except as unnecessary. · python/cpython@6f513bd (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 6f513bd

Remove try-except as unnecessary.

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 2 additions & 5 deletions

Original file line number Diff line number Diff line change
@@ -202,11 +202,8 @@ def name(self):
202 202 "Unique name that identifies the shared memory block."
203 203 reported_name = self._name
204 204 if _USE_POSIX and self._prepend_leading_slash:
205 -try:
206 -if self._name[0] == "/":
207 -reported_name = self._name[1:]
208 -except Exception:
209 -pass
205 +if self._name.startswith("/"):
206 +reported_name = self._name[1:]
210 207 return reported_name
211 208
212 209 @property