Skip to content

Commit a42ae7f

Browse files
committed
bugfix: don't crash PDF backend when not using SVN checkout
svn path=/trunk/matplotlib/; revision=7979
1 parent 57fd362 commit a42ae7f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,14 @@ def __init__(self, filename):
398398
'Pages': self.pagesObject }
399399
self.writeObject(self.rootObject, root)
400400

401-
revision = '$Rev$'.strip('$').split(':')[1].strip()
401+
svn_special_string = '$Rev$' # on checkout, gets replaced by svn client
402+
if ':' in svn_special_string:
403+
revision = ' r'+svn_special_string.strip('$').split(':')[1].strip()
404+
else:
405+
revision = ''
402406
self.infoDict = {
403407
'Creator': 'matplotlib %s, http://matplotlib.sf.net' % __version__,
404-
'Producer': 'matplotlib pdf backend r%s' % revision,
408+
'Producer': 'matplotlib pdf backend%s' % revision,
405409
'CreationDate': datetime.today()
406410
}
407411

0 commit comments

Comments
 (0)