From e9c8de669d40d993489981be2973d1ea5bd10d0c Mon Sep 17 00:00:00 2001
From: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Date: Fri, 29 Jul 2022 09:40:44 +0200
Subject: [PATCH] gh-95273: Condense sqlite3 executescript example (#95383)

---
 Doc/includes/sqlite3/executescript.py | 25 -------------------------
 Doc/library/sqlite3.rst               | 11 +++++++++--
 2 files changed, 9 insertions(+), 27 deletions(-)
 delete mode 100644 Doc/includes/sqlite3/executescript.py

diff --git a/Doc/includes/sqlite3/executescript.py b/Doc/includes/sqlite3/executescript.py
deleted file mode 100644
index aea8943fbee..00000000000
--- a/Doc/includes/sqlite3/executescript.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import sqlite3
-
-con = sqlite3.connect(":memory:")
-cur = con.cursor()
-cur.executescript("""
-    create table person(
-        firstname,
-        lastname,
-        age
-    );
-
-    create table book(
-        title,
-        author,
-        published
-    );
-
-    insert into book(title, author, published)
-    values (
-        'Dirk Gently''s Holistic Detective Agency',
-        'Douglas Adams',
-        1987
-    );
-    """)
-con.close()
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 545f6790afb..1d4454007cf 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -1007,9 +1007,16 @@ Cursor Objects
 
       *sql_script* must be a :class:`string <str>`.
 
-      Example:
+      Example::
 
-      .. literalinclude:: ../includes/sqlite3/executescript.py
+         # cur is an sqlite3.Cursor object
+         cur.executescript("""
+             begin;
+             create table person(firstname, lastname, age);
+             create table book(title, author, published);
+             create table publisher(name, address);
+             commit;
+         """)
 
 
    .. method:: fetchone()
-- 
GitLab