Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 570798 | Differences between
and this patch

Collapse All | Expand All

(-)a/pym/portage/_emirrordist/Config.py (-2 / +9 lines)
Lines 109-115 class Config(object): Link Here
109
		if self.options.dry_run and not os.path.exists(db_file):
109
		if self.options.dry_run and not os.path.exists(db_file):
110
			db = {}
110
			db = {}
111
		else:
111
		else:
112
			db = shelve.open(db_file, flag=open_flag)
112
			try:
113
				db = shelve.open(db_file, flag=open_flag)
114
			except ImportError as e:
115
				# ImportError has different attributes for python2 vs. python3
116
				if (getattr(e, 'name', None) == 'bsddb' or
117
					getattr(e, 'message', None) == 'No module named bsddb'):
118
					from bsddb3 import dbshelve
119
					db = dbshelve.open(db_file, flags=open_flag)
120
113
			if sys.hexversion < 0x3000000:
121
			if sys.hexversion < 0x3000000:
114
				db = ShelveUnicodeWrapper(db)
122
				db = ShelveUnicodeWrapper(db)
115
123
116
- 

Return to bug 570798