Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2a39ed

Browse filesBrowse files
committed
Fixes tzname return type
Closes #7630
1 parent d8f535c commit e2a39ed
Copy full SHA for e2a39ed

File tree

Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed

‎lib/matplotlib/dates.py

Copy file name to clipboardExpand all lines: lib/matplotlib/dates.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def utcoffset(self, dt):
159159
return datetime.timedelta(0)
160160

161161
def tzname(self, dt):
162-
return "UTC"
162+
return str("UTC")
163163

164164
def dst(self, dt):
165165
return datetime.timedelta(0)

‎lib/matplotlib/tests/test_dates.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_dates.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@ def test_DayLocator():
465465
mdates.DayLocator(interval=1.0)
466466

467467

468+
def test_tz_utc():
469+
dt = datetime.datetime(1970, 1, 1, tzinfo=mdates.UTC)
470+
dt.tzname()
471+
472+
468473
if __name__ == '__main__':
469474
import nose
470475
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.