Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1241735?usp=email )

Change subject: IMPR: open nightly version file either in root or in pywikibot 
folder
......................................................................

IMPR: open nightly version file either in root or in pywikibot folder

Change-Id: I21cfd2a761b60cb5f7226c267c32f5f62c346988
---
M pywikibot/version.py
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/pywikibot/version.py b/pywikibot/version.py
index e488f34..3c3e493 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -193,10 +193,10 @@
         - hash (git hash for the current revision)
     :rtype: ``tuple`` of three ``str`` and a ``time.struct_time``
     """
-    file = Path(path or _get_program_dir())
-    if not path:
-        file /= 'pywikibot'  # pragma: no cover
-    file /= 'version'
+    folder = Path(path or _get_program_dir())
+    file = folder / 'version'
+    if not file.exists():
+        file = folder / 'pywikibot' / 'version'

     with file.open() as data:
         (tag, rev, date, hsh) = data.read().splitlines()

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1241735?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I21cfd2a761b60cb5f7226c267c32f5f62c346988
Gerrit-Change-Number: 1241735
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to