Skip to content

Commit 84e9820

Browse files
committed
Replace unicode literals in Basemap.drawmapscale
1 parent 8ec80c6 commit 84e9820

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/basemap/src/mpl_toolkits/basemap/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4528,20 +4528,21 @@ def drawmapscale(self,lon,lat,lon0,lat0,length,barstyle='simple',\
45284528
xc,yc = self(lon,lat)
45294529
# make sure lon_0 between -180 and 180
45304530
lon_0 = ((lon0+360) % 360) - 360
4531+
degchar = b"\xc2\xb0".decode("utf-8")
45314532
if lat0>0:
45324533
if lon>0:
4533-
lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}E' % (lat0,lon_0)
4534+
lonlatstr = '%g%sN, %g%sE' % (lat0, degchar, lon_0, degchar)
45344535
elif lon<0:
4535-
lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
4536+
lonlatstr = '%g%sN, %g%sW' % (lat0, degchar, lon_0, degchar)
45364537
else:
4537-
lonlatstr = u'%g\N{DEGREE SIGN}, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
4538+
lonlatstr = '%g%s, %g%sW' % (lat0, degchar, lon_0, degchar)
45384539
else:
45394540
if lon>0:
4540-
lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}E' % (lat0,lon_0)
4541+
lonlatstr = '%g%sS, %g%sE' % (lat0, degchar, lon_0, degchar)
45414542
elif lon<0:
4542-
lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
4543+
lonlatstr = '%g%sS, %g%sW' % (lat0, degchar, lon_0, degchar)
45434544
else:
4544-
lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}' % (lat0,lon_0)
4545+
lonlatstr = '%g%sS, %g%s' % (lat0, degchar, lon_0, degchar)
45454546
# left edge of scale
45464547
lon1,lat1 = self(x0-length/2,y0,inverse=True)
45474548
x1,y1 = self(lon1,lat1)

0 commit comments

Comments
 (0)