Skip to content

Commit 8113218

Browse files
committed
Merge remote-tracking branch 'upstream/master' into makeboxesoverhault
2 parents f3dcfb9 + 18396f2 commit 8113218

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

mathics/builtin/calculus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class Integrate(SympyFunction):
369369
370370
Integration in TeX:
371371
>> Integrate[f[x], {x, a, b}] // TeXForm
372-
= \int_a^bf\left[x\right] \, dx
372+
= \int_a^b f\left[x\right] \, dx
373373
374374
#> DownValues[Integrate]
375375
= {}
@@ -437,12 +437,12 @@ class Integrate(SympyFunction):
437437
'Integrate[list_List, x_]': 'Integrate[#, x]& /@ list',
438438

439439
'MakeBoxes[Integrate[f_, x_], form:StandardForm|TraditionalForm]':
440-
r'''RowBox[{"\[Integral]", MakeBoxes[f, form], "\[InvisibleTimes]",
440+
r'''RowBox[{"\[Integral]","\[InvisibleTimes]", MakeBoxes[f, form], "\[InvisibleTimes]",
441441
RowBox[{"\[DifferentialD]", MakeBoxes[x, form]}]}]''',
442442
'MakeBoxes[Integrate[f_, {x_, a_, b_}], '
443443
'form:StandardForm|TraditionalForm]':
444444
r'''RowBox[{SubsuperscriptBox["\[Integral]", MakeBoxes[a, form],
445-
MakeBoxes[b, form]], MakeBoxes[f, form], "\[InvisibleTimes]",
445+
MakeBoxes[b, form]], "\[InvisibleTimes]" , MakeBoxes[f, form], "\[InvisibleTimes]",
446446
RowBox[{"\[DifferentialD]", MakeBoxes[x, form]}]}]''',
447447
}
448448

mathics/builtin/system.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,12 @@ class UserName(Predefined):
407407
name = "$UserName"
408408

409409
def evaluate(self, evaluation) -> String:
410-
return String(os.getlogin())
410+
try:
411+
user = os.getlogin()
412+
except:
413+
import pwd
414+
user = pwd.getpwuid(os.getuid())[0]
415+
return String(user)
411416

412417

413418
class Version(Predefined):

mathics/core/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ def __neg__(self) -> 'Rational':
21172117

21182118
@property
21192119
def is_zero(self) -> bool:
2120-
return self.numerator().is_zero and not self.denominator().is_zero()
2120+
return self.numerator().is_zero # (implicit) and not (self.denominator().is_zero)
21212121

21222122

21232123
class Real(Number):

0 commit comments

Comments
 (0)