Skip to content

Commit 85daf73

Browse files
committed
changed to dictionary unpacking to support python 3.8
1 parent 3ff69ae commit 85daf73

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

striprtf/striprtf.py

+27-24
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,33 @@
8989
# and section characters reset formatting
9090
sectionchars = {"par": "\n", "sect": "\n\n", "page": "\n\n"}
9191
specialchars = {
92-
"line": "\n",
93-
"tab": "\t",
94-
"emdash": "\u2014",
95-
"endash": "\u2013",
96-
"emspace": "\u2003",
97-
"enspace": "\u2002",
98-
"qmspace": "\u2005",
99-
"bullet": "\u2022",
100-
"lquote": "\u2018",
101-
"rquote": "\u2019",
102-
"ldblquote": "\u201C",
103-
"rdblquote": "\u201D",
104-
"row": "\n",
105-
"cell": "|",
106-
"nestcell": "|",
107-
"~": "\xa0",
108-
"\n": "\n",
109-
"\r": "\r",
110-
"{": "{",
111-
"}": "}",
112-
"\\": "\\",
113-
"-": "\xad",
114-
"_": "\u2011",
115-
} | sectionchars
92+
**{
93+
"line": "\n",
94+
"tab": "\t",
95+
"emdash": "\u2014",
96+
"endash": "\u2013",
97+
"emspace": "\u2003",
98+
"enspace": "\u2002",
99+
"qmspace": "\u2005",
100+
"bullet": "\u2022",
101+
"lquote": "\u2018",
102+
"rquote": "\u2019",
103+
"ldblquote": "\u201C",
104+
"rdblquote": "\u201D",
105+
"row": "\n",
106+
"cell": "|",
107+
"nestcell": "|",
108+
"~": "\xa0",
109+
"\n": "\n",
110+
"\r": "\r",
111+
"{": "{",
112+
"}": "}",
113+
"\\": "\\",
114+
"-": "\xad",
115+
"_": "\u2011",
116+
},
117+
**sectionchars,
118+
}
116119

117120
PATTERN = re.compile(
118121
r"\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)",

0 commit comments

Comments
 (0)