@@ -103,7 +103,7 @@ class ExprWarning(UserWarning):
103
103
pass
104
104
105
105
106
- def warn (message ):
106
+ def ewarn (message ):
107
107
warnings .warn (message , ExprWarning , stacklevel = 2 )
108
108
109
109
@@ -489,7 +489,7 @@ def __getitem__(self, index):
489
489
if not isinstance (index , tuple ):
490
490
index = index ,
491
491
if len (index ) > 1 :
492
- warn (f'C-index should be a single expression but got `{ index } `' )
492
+ ewarn (f'C-index should be a single expression but got `{ index } `' )
493
493
return Expr (Op .INDEXING , (self ,) + index )
494
494
495
495
def substitute (self , symbols_map ):
@@ -525,8 +525,8 @@ def substitute(self, symbols_map):
525
525
else :
526
526
r += term .substitute (symbols_map ) * coeff
527
527
if r is None :
528
- warn ('substitute: empty TERMS expression interpreted as'
529
- ' int-literal 0' )
528
+ ewarn ('substitute: empty TERMS expression interpreted as'
529
+ ' int-literal 0' )
530
530
return as_number (0 )
531
531
return r
532
532
if self .op is Op .FACTORS :
@@ -537,8 +537,8 @@ def substitute(self, symbols_map):
537
537
else :
538
538
r *= base .substitute (symbols_map ) ** exponent
539
539
if r is None :
540
- warn ('substitute: empty FACTORS expression interpreted'
541
- ' as int-literal 1' )
540
+ ewarn ('substitute: empty FACTORS expression interpreted'
541
+ ' as int-literal 1' )
542
542
return as_number (1 )
543
543
return r
544
544
if self .op is Op .APPLY :
@@ -1260,5 +1260,5 @@ def _fromstring_worker(s, dummy=None):
1260
1260
# f2py special dummy name
1261
1261
return as_symbol (r )
1262
1262
1263
- warn (f'fromstring: treating { r !r} as symbol' )
1263
+ ewarn (f'fromstring: treating { r !r} as symbol' )
1264
1264
return as_symbol (r )
0 commit comments