Fix the ispunct ctype implementation.

This commit is contained in:
Reece H. Dunn
2018-05-03 21:29:17 +01:00
parent d6c1b5d597
commit df247b7cab
3 changed files with 7 additions and 18 deletions
+1 -4
View File
@@ -78,10 +78,7 @@ def isblank(data): # word separator
return 0
def ispunct(data):
if data.get('GeneralCategory', 'Cn')[0] in 'P':
return 1
else:
return 0
return 1 if isgraph(data) and not isalnum(data) else 0
def isprint(data):
if data.get('GeneralCategory', 'Cn')[0] in 'LMNPSZ': # not in 'CI'