Remove try-except as unnecessary. · python/cpython@6f513bd (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
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 |