parent
5e74f259f3
commit
a0f55e48fa
@ -1,39 +0,0 @@ |
||||
diff --git a/src/sage/repl/image.py b/src/sage/repl/image.py
|
||||
index d7d00b0..cd1607a 100644
|
||||
--- a/src/sage/repl/image.py
|
||||
+++ b/src/sage/repl/image.py
|
||||
@@ -77,7 +77,7 @@ class Image(SageObject):
|
||||
|
||||
- ``size`` -- 2-tuple, containing (width, height) in pixels.
|
||||
|
||||
- - ``color`` -- string or tuple of numeric. What colour to use
|
||||
+ - ``color`` -- string, numeric or tuple of numeric. What colour to use
|
||||
for the image. Default is black. If given, this should be a
|
||||
a tuple with one value per band. When creating RGB images,
|
||||
you can also use colour strings as supported by the
|
||||
@@ -91,9 +91,15 @@ class Image(SageObject):
|
||||
EXAMPLES::
|
||||
|
||||
sage: from sage.repl.image import Image
|
||||
- sage: Image('P', (16, 16), (13,))
|
||||
+ sage: Image('P', (16, 16), 13)
|
||||
16x16px 8-bit Color image
|
||||
"""
|
||||
+ # pillow does not support Sage integers as color
|
||||
+ from sage.rings.integer import Integer
|
||||
+ if isinstance(color, Integer):
|
||||
+ color = int(color)
|
||||
+ elif isinstance(color, tuple):
|
||||
+ color = tuple(int(i) if isinstance(i, Integer) else i for i in color)
|
||||
self._pil = PIL.Image.new(mode, size, color)
|
||||
|
||||
@property
|
||||
@@ -233,7 +239,7 @@ class Image(SageObject):
|
||||
EXAMPLES::
|
||||
|
||||
sage: from sage.repl.image import Image
|
||||
- sage: img = Image('P', (12, 34), (13,))
|
||||
+ sage: img = Image('P', (12, 34), 13)
|
||||
sage: filename = tmp_filename(ext='.png')
|
||||
sage: img.save(filename)
|
||||
sage: with open(filename, 'rb') as f:
|
@ -1,36 +0,0 @@ |
||||
diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
|
||||
index cb3667659e..867f547d71 100644
|
||||
--- a/src/sage/doctest/forker.py
|
||||
+++ b/src/sage/doctest/forker.py
|
||||
@@ -200,6 +200,15 @@ def init_sage(controller=None):
|
||||
from sage.cpython._py2_random import Random
|
||||
sage.misc.randstate.DEFAULT_PYTHON_RANDOM = Random
|
||||
|
||||
+ # IPython's pretty printer sorts the repr of dicts by their keys by default
|
||||
+ # (or their keys' str() if they are not otherwise orderable). However, it
|
||||
+ # disables this for CPython 3.6+ opting to instead display dicts' "natural"
|
||||
+ # insertion order, which is preserved in those versions).
|
||||
+ # However, this order is random in some instances.
|
||||
+ # Also modifications of code may affect the order.
|
||||
+ # So here we fore sorted dict printing.
|
||||
+ IPython.lib.pretty.for_type(dict, _sorted_dict_pprinter_factory('{', '}'))
|
||||
+
|
||||
if controller is None:
|
||||
import sage.repl.ipython_kernel.all_jupyter
|
||||
else:
|
||||
@@ -222,15 +231,6 @@ def init_sage(controller=None):
|
||||
from sage.repl.rich_output.backend_doctest import BackendDoctest
|
||||
dm.switch_backend(BackendDoctest())
|
||||
|
||||
- # IPython's pretty printer sorts the repr of dicts by their keys by default
|
||||
- # (or their keys' str() if they are not otherwise orderable). However, it
|
||||
- # disables this for CPython 3.6+ opting to instead display dicts' "natural"
|
||||
- # insertion order, which is preserved in those versions).
|
||||
- # However, this order is random in some instances.
|
||||
- # Also modifications of code may affect the order.
|
||||
- # So here we fore sorted dict printing.
|
||||
- IPython.lib.pretty.for_type(dict, _sorted_dict_pprinter_factory('{', '}'))
|
||||
-
|
||||
# Switch on extra debugging
|
||||
from sage.structure.debug_options import debug
|
||||
debug.refine_category_hash_check = True
|
@ -1,13 +0,0 @@ |
||||
diff --git a/src/sage/interfaces/sagespawn.pyx b/src/sage/interfaces/sagespawn.pyx
|
||||
index 9041238f1d..469befbc66 100644
|
||||
--- a/src/sage/interfaces/sagespawn.pyx
|
||||
+++ b/src/sage/interfaces/sagespawn.pyx
|
||||
@@ -228,7 +228,7 @@ class SagePtyProcess(PtyProcess):
|
||||
Check that the process eventually dies after calling
|
||||
``terminate_async``::
|
||||
|
||||
- sage: s.ptyproc.terminate_async(interval=0.2)
|
||||
+ sage: s.ptyproc.terminate_async(interval=float(0.2))
|
||||
sage: while True:
|
||||
....: try:
|
||||
....: os.kill(s.pid, 0)
|
Loading…
Reference in new issue