Skip to content

Commit 4e10689

Browse files
committed
Fixed an error with AIML Parser pickling state
1 parent b90937d commit 4e10689

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ conversations/
109109
/src/utils/pattern_lister/y-bot.csv
110110
/src/utils/rdf_lister/rdfs.csv
111111
/src/utils/botflow/
112+
/bots/botflow/
113+
bots/botflow/

src/programy/parser/aiml_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ def __getstate__(self):
6161
# __getstate__ is called during the pickling process to determin whih
6262
# attributes to load, so we remove the ones we don't want pickling
6363
d = dict(self.__dict__)
64-
del d['_errors']
65-
del d['_duplicates']
64+
if '_errors' in d:
65+
del d['_errors']
66+
if '_duplicates' in d:
67+
del d['_duplicates']
6668
return d
6769

6870
@property

0 commit comments

Comments
 (0)