Merge pull request #35 from classabbyamp/bare-excepts

fixed bare excepts
This commit is contained in:
0x5c 2019-10-12 20:24:40 -04:00 committed by GitHub
commit baede1099a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class MorseCog(commands.Cog):
for char in msg.upper():
try:
result += self.ascii2morse[char]
except:
except KeyError:
result += '<?>'
result += ' '
embed = discord.Embed(title=f'Morse Code for {msg}',
@ -53,7 +53,7 @@ class MorseCog(commands.Cog):
for char in word:
try:
result += self.morse2ascii[char]
except:
except KeyError:
result += '<?>'
result += ' '
embed = discord.Embed(title=f'ASCII for {msg0}',
@ -74,7 +74,7 @@ class MorseCog(commands.Cog):
try:
cwChar = self.ascii2morse[char].replace('-', '==')
weight += len(cwChar) * 2 + 2
except:
except KeyError:
res = f'Unknown character {char} in callsign'
await ctx.send(res)
return