Skip to content

Commit ad04953

Browse files
committed
some fixes from ruff UP warnings
1 parent aa27703 commit ad04953

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

src/sage/all_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def test_import_sage_all_in_fresh_interpreter():
1313

1414
proc = subprocess.run(
1515
[sys.executable, "-c", "import sage.all"],
16-
stdout=subprocess.PIPE,
17-
stderr=subprocess.PIPE,
16+
capture_output=True,
1817
env=env,
1918
text=True, check=False,
2019
)

src/sage/doctest/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _proc_stat_cpu_seconds(self, path):
181181
182182
"""
183183
try:
184-
with open(path, "r") as statfile:
184+
with open(path) as statfile:
185185
stats = statfile.read().split()
186186
except (FileNotFoundError, PermissionError) as e:
187187
# FileNotFoundError: bad PID, or no /proc support

src/sage/matroids/chow_ring_ideal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def _latex_(self) -> str:
10341034
'I_{FY}(\\text{\\texttt{Graphic{ }matroid{ }of{ }rank{ }2{ }on{ }3{ }elements}})'
10351035
"""
10361036
from sage.misc.latex import latex
1037-
return 'I_{{FY}}({})'.format((latex(self._matroid)))
1037+
return 'I_{{FY}}({})'.format(latex(self._matroid))
10381038

10391039
def groebner_basis(self, algorithm='', *args, **kwargs):
10401040
r"""

src/sage/rings/lazy_species.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ def coeff(g, i):
11731173

11741174
def flat(g):
11751175
# function needed to work around python's scoping rules
1176-
return itertools.chain.from_iterable((coeff(g, j) for j in itertools.count()))
1176+
return itertools.chain.from_iterable(coeff(g, j) for j in itertools.count())
11771177

11781178
args_flat1 = [lazy_list(flat(g)) for g in args]
11791179

src/sage/rings/padics/witt_vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _int_to_vector(self, k, parent):
266266
if p == 2:
267267
vec_k = (
268268
parent(vec_k)
269-
* parent((tuple(-1 for _ in range(self._prec))))
269+
* parent(tuple(-1 for _ in range(self._prec)))
270270
).coordinates()
271271
else:
272272
vec_k = (-x for x in vec_k)

src/sage/rings/polynomial/multi_polynomial_sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ def __add__(self, right):
13131313
if isinstance(right, PolynomialSequence_generic) and right.ring() == self.ring():
13141314
return PolynomialSequence(self.ring(), self.parts() + right.parts())
13151315

1316-
elif isinstance(right, (tuple, list)) and all((x.parent() == self.ring() for x in right)):
1316+
elif isinstance(right, (tuple, list)) and all(x.parent() == self.ring() for x in right):
13171317
return PolynomialSequence(self.ring(), self.parts() + (right,))
13181318

13191319
elif isinstance(right, MPolynomialIdeal) and (right.ring() is self.ring() or right.ring() == self.ring()):

0 commit comments

Comments
 (0)