Skip to content

Commit c4f7b06

Browse files
committed
Remove remaining usage of sage-python
1 parent 97d834b commit c4f7b06

13 files changed

+39
-31
lines changed

src/bin/math-readline

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22

33
# Cleverly run Mathematica with the benefit of readline, which
44
# is something the usual commercial mathematica doesn't provide!
55
# See
66
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/363500
77

8-
import sys
98
import signal
109
import subprocess
10+
import sys
11+
1112
from sage.cpython.string import str_to_bytes
1213

14+
1315
def child_exited(*args):
1416
global child
1517
status = child.poll()

src/bin/sage-cachegrind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ else
2121
echo $CACHEGRIND_FLAGS
2222
fi
2323

24-
valgrind --tool=cachegrind $CACHEGRIND_FLAGS sage-python -i
24+
valgrind --tool=cachegrind $CACHEGRIND_FLAGS python3 -i
2525

src/bin/sage-cleaner

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22

33
#*****************************************************************************
44
# This is the sage monitor *daemon*, which cleans up after Sage.
@@ -17,8 +17,14 @@
1717
#*****************************************************************************
1818

1919

20-
import os, shutil, sys, time, socket, errno, signal, atexit
21-
20+
import atexit
21+
import errno
22+
import os
23+
import shutil
24+
import signal
25+
import socket
26+
import sys
27+
import time
2228

2329
HOSTNAME = os.environ.get('HOSTNAME', socket.gethostname())
2430
DOT_SAGE = os.environ['DOT_SAGE']
@@ -30,6 +36,7 @@ pidfile = os.path.join(SAGE_TMP_ROOT, 'cleaner.pid')
3036
old_pidfile = os.path.join(DOT_SAGE, 'temp', 'cleaner-%s.pid'%HOSTNAME)
3137

3238
import logging
39+
3340
logger = logging.getLogger(__name__)
3441

3542

src/bin/sage-eval

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22

33
import sys
4+
45
from sage.all import *
5-
from sage.calculus.predefined import x
6+
from sage.calculus.predefined import x # noqa: F401
67
from sage.repl.preparse import preparse
78

89
if len(sys.argv) > 1:

src/bin/sage-ipython

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
"""
44
Sage IPython startup script.
@@ -7,6 +7,7 @@ Sage IPython startup script.
77
# Display startup banner. Do this before anything else to give the user
88
# early feedback that Sage is starting.
99
from sage.misc.banner import banner
10+
1011
banner()
1112

1213
from sage.repl.interpreter import SageTerminalApp

src/bin/sage-massif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ else
2121
echo $MASSIF_FLAGS
2222
fi
2323

24-
valgrind --tool=massif $MASSIF_FLAGS sage-python -i
24+
valgrind --tool=massif $MASSIF_FLAGS python3 -i
2525

src/bin/sage-notebook

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8; mode: python -*-
33

4-
import os
5-
import sys
6-
import ast
74
import argparse
85
import logging
9-
import textwrap
6+
import os
7+
import sys
108
from contextlib import contextmanager
119

1210
logging.basicConfig()
1311
logger = logging.getLogger()
1412

1513
from sage.misc.banner import banner
1614

17-
1815
_system_jupyter_url = "https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation"
1916

2017

@@ -188,7 +185,9 @@ def sage_doc_server():
188185
from functools import partial
189186
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
190187
from threading import Thread
191-
from sage.env import SAGE_DOC, SAGE_DOC_LOCAL_PORT as port
188+
189+
from sage.env import SAGE_DOC
190+
from sage.env import SAGE_DOC_LOCAL_PORT as port
192191

193192
server = ThreadingHTTPServer(('127.0.0.1', int(port)),
194193
partial(SimpleHTTPRequestHandler, directory=SAGE_DOC))

src/bin/sage-omega

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ else
2121
echo $OMEGA_FLAGS
2222
fi
2323

24-
valgrind --tool=exp-omega $OMEGA_FLAGS sage-python -i
24+
valgrind --tool=exp-omega $OMEGA_FLAGS python3 -i
2525

src/bin/sage-preparse

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env sage-python
1+
#!/usr/bin/env python3
22
"""
33
Preparse .sage files and save the result to .sage.py files.
44
@@ -11,11 +11,11 @@ AUTHOR:
1111
"""
1212

1313
import os
14-
import sys
1514
import re
15+
import sys
1616

17-
from sage.repl.preparse import preparse_file
1817
from sage.misc.temporary_file import atomic_write
18+
from sage.repl.preparse import preparse_file
1919

2020
# The spkg/bin/sage script passes the files to be preparsed as
2121
# arguments (but remove sys.argv[0]).

src/bin/sage-python

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)