From f2691e89f534af823e78ad93693dbbd57685e10f Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Fri, 4 Sep 2020 14:46:49 -0400 Subject: [PATCH] Fix make_constant() in the AST module, to always return a constant. It was failing to do so for timestamps, instead returning a STIXdatetime object. --- stix2/patterns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stix2/patterns.py b/stix2/patterns.py index bbee7ac..f1472cd 100644 --- a/stix2/patterns.py +++ b/stix2/patterns.py @@ -227,7 +227,7 @@ def make_constant(value): return value try: - return parse_into_datetime(value) + return TimestampConstant(value) except (ValueError, TypeError): pass