# HG changeset patch
# User David Roe <roed@math.harvard.edu>
# Date 1328830307 28800
# Node ID eab6a96c109744952b8fbff20c31317e93780395
# Parent 8a949887e36294a37d8713298a7dd2eeaf25659e
#12480: Fix padics bug appearing in OS X 10.7
diff git a/sage/rings/padics/padic_ZZ_pX_CR_element.pyx b/sage/rings/padics/padic_ZZ_pX_CR_element.pyx
a

b


631  631  sage: F = W.fraction_field() 
632  632  sage: z = F(1+w); z # indirect doctest 
633  633  1 + w + O(w^1530) 
 634  sage: z = F(w+w^2,relprec=0); z 
 635  O(w) 
634  636  """ 
635  637  self.ordp = ordp 
636  638  self._set_prec_rel(relprec) 
… 
… 

920  922  # the 1 in the next line signals that there is no absprec specified 
921  923  self._set_from_ZZX_part1(poly, 1, relprec) 
922  924  # context was restored in _set_from_ZZX_part1 
 925  if relprec == 0: 
 926  self._set_prec_rel(relprec) 
 927  return 0 
923  928  if self.relprec + self.ordp != 0: 
924  929  self.prime_pow.restore_context_capdiv(self.relprec + self.ordp) 
925  930  ZZX_to_ZZ_pX(self.unit, poly) 
… 
… 

1036  1041  self._set_inexact_zero(ctx_prec) 
1037  1042  return 0 
1038  1043  self._set_from_ZZ_pX_part1(poly) 
 1044  if relprec == 0: 
 1045  self._set_prec_rel(relprec) 
 1046  return 0 
1039  1047  if ctx_prec == 1: 
1040  1048  self._set_prec_rel(self.ordp + relprec) 
1041  1049  else: 
… 
… 

1296  1304  sage: y # indirect doctest 
1297  1305  w^5 + w^6 + 2*w^7 + 4*w^8 + 3*w^10 + w^12 + 4*w^13 + 4*w^14 + 4*w^15 + 4*w^16 + 4*w^17 + 4*w^20 + w^21 + 4*w^24 + O(w^25) 
1298  1306  """ 
 1307  if self.relprec == 0: 
 1308  raise RuntimeError("padic Internal lshift called with relative precision 0") 
1299  1309  cdef ZZ_pX_c tmpP 
1300  1310  cdef ZZ_pX_Modulus_c* mod 
1301  1311  if self.prime_pow.e == 1: 