summaryrefslogtreecommitdiff
path: root/dev-python/apsw/files/apsw-3.39.3.0-test.patch
blob: 764fe4844bca3b527d5594cd80727cf43327a834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From a28713a9ebcc8d393beb270ca9fd5bf3b86a52bb Mon Sep 17 00:00:00 2001
From: Roger Binns <rogerb@rogerbinns.com>
Date: Thu, 22 Sep 2022 08:33:13 -0700
Subject: [PATCH] Ensure uncompleted statement is present

It turns out that under some circumstances Python hasattr
is actually doing a getattr.  That means an incomplete statement
needs to be present for the hasattr to not raise an exception.

See #370
---
 apsw/tests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apsw/tests.py b/apsw/tests.py
index bdaf70d..e9ad3c0 100644
--- a/apsw/tests.py
+++ b/apsw/tests.py
@@ -772,6 +772,7 @@ class APSW(unittest.TestCase):
         c.execute("drop table foo; create table foo (%s)" % (", ".join(["[%s] %s" % (n, t) for n, t in cols]), ))
         c.execute("insert into foo([x a space]) values(1)")
         c.execute("create temp table two(fred banana); insert into two values(7); create temp view three as select fred as [a space] from two")
+        c.execute("select 3") # see issue #370
         has_full=any(o=="ENABLE_COLUMN_METADATA" or o.startswith("ENABLE_COLUMN_METADATA=") for o in apsw.compile_options) if apsw.using_amalgamation else hasattr(c, "description_full")
         for row in c.execute("select * from foo"):
             self.assertEqual(cols, c.getdescription())
@@ -8835,4 +8836,4 @@ if __name__ == '__main__':
     del re
     gc.collect()
 
-    exit(exitcode)
\ No newline at end of file
+    exit(exitcode)
-- 
2.37.3